Hyperspectral Imaging Method, Device, Computer Equipment and Storage Medium
Through the combination of hyperspectral camera and compensation camera, image acquisition and reconstruction processing are performed, the problem of low imaging accuracy in hyperspectral imaging technology is solved, and the compensation of the complete planar image and hyperspectral data of the target sample is achieved, and the imaging accuracy is improved.
Patent Information
- Application Number
- CN202211334580.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-10-28
AI Technical Summary
In the existing hyperspectral imaging technology, due to the fast moving speed of the sample displacement platform, there is no overlapping part or no docking between adjacent two plane images, resulting in missing part of the planar image and hyperspectral data of the hyperspectral image, and the imaging accuracy is low.
By using a method combining a hyperspectral camera and a compensation camera, image acquisition and reconstruction processing are performed, and the first hyperspectral image is compensated and spectral compensation is performed on the first hyperspectral image based on the target plane image to obtain the target hyperspectral image.
The imaging accuracy of hyperspectral images is improved, the integrity of the planar image and hyperspectral data of the target sample is ensured, and the imaging quality is improved.
Smart Images

Figure CN115717937B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of microscopic imaging technology, and in particular to a hyperspectral imaging method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the development of microscopic imaging technology, hyperspectral imaging has emerged. This technology can generate hyperspectral images of target samples. Based on these images, information such as the sample's morphological structure, internal physical structure, and chemical composition can be inferred. Therefore, hyperspectral imaging technology has applications in remote sensing, surface inspection, mineral detection, and medical diagnosis.
[0003] In traditional hyperspectral imaging technology, spatial scanning or spectral scanning is used to obtain a plane image of the target sample and the hyperspectral data corresponding to the plane image, and spectral imaging processing is performed based on the plane image and the hyperspectral data corresponding to the plane image to obtain a hyperspectral image of the target sample.
[0004] However, in current hyperspectral imaging technology, the sample displacement platform moves at a relatively fast speed during spatial scanning or spectral scanning, resulting in no overlap between two adjacent plane images, or causing two adjacent plane images to fail to connect, which in turn causes the hyperspectral image after spectral imaging to lack part of the plane image of the target sample and the hyperspectral data of this part of the plane image, ultimately resulting in low imaging accuracy of the hyperspectral image. Summary of the Invention
[0005] Based on this, it is necessary to provide a hyperspectral imaging method, device, computer equipment, computer-readable storage medium and computer program product that can improve the imaging accuracy of hyperspectral images in response to the above technical problems.
[0006] In a first aspect, the present application provides a hyperspectral imaging method. The method comprises:
[0007] Performing spectral imaging processing on a first plane image obtained by image acquisition of a target sample by the hyperspectral camera and hyperspectral data corresponding to the first plane image to obtain a first hyperspectral image; wherein the target sample is placed on the sample displacement platform, and the sample displacement platform is displaced at a target displacement rate;
[0008] Reconstructing a second plane image obtained by capturing an image of the target sample with the compensation camera to obtain a target plane image containing the target sample;
[0009] Based on the target planar image, perform planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image, and perform spectral compensation processing on the second hyperspectral image to obtain the target hyperspectral image of the target sample.
[0010] In one embodiment, the performing spectral compensation processing on the second hyperspectral image to obtain the target hyperspectral image of the target sample includes:
[0011] For each compensated planar pixel in the second hyperspectral image, determine the hyperspectral pixel closest to the compensated planar pixel according to the compensated planar pixel to obtain a compensated hyperspectral pixel;
[0012] Based on the hyperspectral data in the compensated hyperspectral pixel, perform spectral compensation processing on the compensated planar pixel corresponding to the compensated hyperspectral pixel to obtain the target hyperspectral image of the target sample.
[0013] In one embodiment, the performing planar image compensation processing on the first hyperspectral image based on the target planar image to obtain a second hyperspectral image includes:
[0014] Overlay the target planar image and the first hyperspectral image, and in the target planar image, determine the image area that does not overlap with the first hyperspectral image to obtain a target compensation image area;
[0015] Based on the target compensation image area, perform planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image.
[0016] In one embodiment, before performing spectral imaging processing on the first planar image obtained by image acquisition of the target sample by the hyperspectral camera and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image, it further includes:
[0017] Among the test imaging accuracies of each test hyperspectral image, determine the test imaging accuracy that matches the target imaging accuracy of the target sample to obtain a reference imaging accuracy;
[0018] According to the initial displacement rate of the sample displacement platform corresponding to the reference imaging accuracy, determine the target displacement rate of the sample displacement platform.
[0019] In one embodiment, before determining the test imaging accuracy that matches the target imaging accuracy of the target sample among the test imaging accuracies of each test hyperspectral image to obtain a reference imaging accuracy, it further includes:
[0020] Performing spectral imaging processing on the third planar image obtained by image acquisition of the target test sample using the hyperspectral camera and the hyperspectral data corresponding to the third planar image to obtain the third hyperspectral image of the target test sample; wherein, the target test sample is placed on the sample displacement platform, and the sample displacement platform is displaced at an initial displacement rate;
[0021] Performing reconstruction processing on the fourth planar image obtained by image acquisition of the target test sample using the compensation camera to obtain a target test planar image including the target test sample;
[0022] Based on the target test planar image, performing planar image compensation processing on the third hyperspectral image to obtain a fourth hyperspectral image, and performing spectral compensation processing on the fourth hyperspectral image to obtain the test hyperspectral image of the target test sample;
[0023] According to a preset test imaging accuracy range and the test imaging accuracy of the test hyperspectral image, re-determining the initial displacement rate, and returning to execute the step of performing spectral imaging processing on the third planar image obtained by image acquisition of the target test sample using the hyperspectral camera and the hyperspectral data corresponding to the third planar image, until the test imaging accuracy meets the preset stop condition, to obtain each of the test imaging accuracies and the initial displacement rate of the sample displacement platform corresponding to the test imaging accuracy.
[0024] In one embodiment, in the test imaging accuracies of each test hyperspectral image, determining the test imaging accuracy that matches the target imaging accuracy of the target sample to obtain the reference imaging accuracy includes:
[0025] According to the target imaging accuracy of the target sample, determining an imaging accuracy range including the target imaging accuracy;
[0026] For the test imaging accuracy of each test hyperspectral image, in the case where the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy, taking the test imaging accuracy as the reference imaging accuracy.
[0027] In a second aspect, the present application further provides a hyperspectral imaging system. The system includes a sample displacement platform, a compensation camera, a hyperspectral camera, and a processor, wherein:
[0028] The sample displacement platform is used to be displaced at a target displacement rate;
[0029] The hyperspectral camera is used to acquire a first planar image of the target sample and the hyperspectral data corresponding to the first planar image; wherein, the target sample is placed on the sample displacement platform;
[0030] The compensation camera is used to collect a second planar image of the target sample;
[0031] The processor is configured to perform spectral imaging processing on the first planar image obtained by the hyperspectral camera for image acquisition of the target sample and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image; perform reconstruction processing on the second planar image obtained by the compensation camera for image acquisition of the target sample to obtain a target planar image including the target sample; perform planar image compensation processing on the first hyperspectral image based on the target planar image to obtain a second hyperspectral image, and perform spectral compensation processing on the second hyperspectral image to obtain the target hyperspectral image of the target sample.
[0032] In one embodiment, the processor is specifically configured to:
[0033] For each compensated planar pixel in the second hyperspectral image, determine the hyperspectral pixel closest to the compensated planar pixel according to the compensated planar pixel to obtain a compensated hyperspectral pixel;
[0034] Perform spectral compensation processing on the compensated planar pixel corresponding to the compensated hyperspectral pixel based on the hyperspectral data in the compensated hyperspectral pixel to obtain the target hyperspectral image of the target sample.
[0035] In one embodiment, the processor is specifically configured to:
[0036] Overlap the target planar image with the first hyperspectral image, and in the target planar image, determine an image area that does not overlap with the first hyperspectral image to obtain a target compensation image area;
[0037] Perform planar image compensation processing on the first hyperspectral image based on the target compensation image area to obtain a second hyperspectral image.
[0038] In one embodiment, the processor is further configured to:
[0039] Among the test imaging precisions of each test hyperspectral image, determine the test imaging precision that matches the target imaging precision of the target sample to obtain a reference imaging precision;
[0040] Determine the target displacement rate of the sample displacement platform according to the initial displacement rate of the sample displacement platform corresponding to the reference imaging precision.
[0041] In one embodiment, the processor is further configured to:
[0042] Performing spectral imaging processing on the third planar image obtained by collecting an image of the target test sample using the hyperspectral camera and the hyperspectral data corresponding to the third planar image to obtain the third hyperspectral image of the target test sample; wherein, the target test sample is placed on the sample displacement platform, and the sample displacement platform is displaced at an initial displacement rate;
[0043] Performing reconstruction processing on the fourth planar image obtained by collecting an image of the target test sample using the compensation camera to obtain a target test planar image including the target test sample;
[0044] Based on the target test planar image, performing planar image compensation processing on the third hyperspectral image to obtain a fourth hyperspectral image, and performing spectral compensation processing on the fourth hyperspectral image to obtain the test hyperspectral image of the target test sample;
[0045] According to a preset test imaging accuracy range and the test imaging accuracy of the test hyperspectral image, re-determining the initial displacement rate, and returning to execute the step of performing spectral imaging processing on the third planar image obtained by collecting an image of the target test sample using the hyperspectral camera and the hyperspectral data corresponding to the third planar image until the test imaging accuracy meets the preset stop condition, to obtain each of the test imaging accuracies and the initial displacement rate of the sample displacement platform corresponding to the test imaging accuracy.
[0046] In one embodiment, the processor is specifically configured to:
[0047] Determining an imaging accuracy range including the target imaging accuracy according to the target imaging accuracy of the target sample;
[0048] For the test imaging accuracy of each test hyperspectral image, in the case where the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy, using the test imaging accuracy as the reference imaging accuracy.
[0049] In a third aspect, the present application further provides a hyperspectral imaging device. The device includes:
[0050] A first determination module, configured to perform spectral imaging processing on a first planar image obtained by collecting an image of a target sample using a hyperspectral camera and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image; wherein, the target sample is placed on the sample displacement platform, and the sample displacement platform is displaced at a target displacement rate;
[0051] A second determination module, configured to perform reconstruction processing on a second planar image obtained by image acquisition of the target sample by a compensation camera, to obtain a target planar image including the target sample;
[0052] A first compensation module, configured to perform planar image compensation processing on the first hyperspectral image based on the target planar image, to obtain a second hyperspectral image, and perform spectral compensation processing on the second hyperspectral image, to obtain a target hyperspectral image of the target sample.
[0053] In one embodiment, the first compensation module is specifically configured to:
[0054] For each compensated planar pixel in the second hyperspectral image, determine a hyperspectral pixel closest to the compensated planar pixel according to the compensated planar pixel, to obtain a compensated hyperspectral pixel;
[0055] Based on the hyperspectral data in the compensated hyperspectral pixel, perform spectral compensation processing on the compensated planar pixel corresponding to the compensated hyperspectral pixel, to obtain a target hyperspectral image of the target sample.
[0056] In one embodiment, the first compensation module is specifically configured to:
[0057] Perform overlapping processing on the target planar image and the first hyperspectral image, and in the target planar image, determine an image area that does not overlap with the first hyperspectral image, to obtain a target compensation image area;
[0058] Based on the target compensation image area, perform planar image compensation processing on the first hyperspectral image, to obtain a second hyperspectral image.
[0059] In one embodiment, the hyperspectral imaging device further includes:
[0060] A third determination module, configured to determine a test imaging accuracy that matches the target imaging accuracy of the target sample from the test imaging accuracies of the test hyperspectral images, to obtain a reference imaging accuracy;
[0061] A fourth determination module, configured to determine a target displacement rate of the sample displacement platform according to the initial displacement rate of the sample displacement platform corresponding to the reference imaging accuracy.
[0062] In one embodiment, the hyperspectral imaging device further includes:
[0063] A fifth determination module, configured to perform spectral imaging processing on a third planar image obtained by collecting an image of a target test sample using the hyperspectral camera and hyperspectral data corresponding to the third planar image, to obtain a third hyperspectral image of the target test sample; wherein, the target test sample is placed on the sample displacement platform, and the sample displacement platform is displaced at an initial displacement rate;
[0064] A sixth determination module, configured to perform reconstruction processing on a fourth planar image obtained by collecting an image of the target test sample using the compensation camera, to obtain a target test planar image including the target test sample;
[0065] A second compensation module, configured to perform planar image compensation processing on the third hyperspectral image based on the target test planar image to obtain a fourth hyperspectral image, and perform spectral compensation processing on the fourth hyperspectral image to obtain a test hyperspectral image of the target test sample;
[0066] A loop module, configured to re-determine the initial displacement rate according to a preset test imaging accuracy range and the test imaging accuracy of the test hyperspectral image, and return to execute the step of performing spectral imaging processing on a third planar image obtained by collecting an image of a target test sample using the hyperspectral camera and hyperspectral data corresponding to the third planar image, until the test imaging accuracy meets a preset stop condition, to obtain each of the test imaging accuracies and the initial displacement rate of the sample displacement platform corresponding to the test imaging accuracy.
[0067] In one embodiment, the third determination module is specifically configured to:
[0068] Determine an imaging accuracy range including the target imaging accuracy according to the target imaging accuracy of the target sample;
[0069] For the test imaging accuracy of each test hyperspectral image, when the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy, use the test imaging accuracy as the reference imaging accuracy.
[0070] In a fourth aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps described in the first aspect are implemented.
[0071] In a fifth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps described in the first aspect are implemented.
[0072] Sixth aspect, the present application also provides a computer program product. The present application also provides a computer program product. The computer program product includes a computer program which, when executed by a processor, implements the steps described in the first aspect.
[0073] The above hyperspectral imaging method, device, computer device, storage medium and computer program product perform spectral imaging processing on the first planar image obtained by collecting an image of a target sample based on a hyperspectral camera and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image; wherein, the target sample is placed on a sample displacement platform, and the sample displacement platform is displaced at a target displacement rate; reconstructing the second planar image obtained by collecting an image of the target sample based on a compensation camera to obtain a target planar image including the target sample; based on the target planar image, performing planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image, and performing spectral compensation processing on the second hyperspectral image to obtain a target hyperspectral image of the target sample. That is to say, this solution performs planar image compensation processing on the first hyperspectral image based on the target planar image to obtain a second hyperspectral image, thereby compensating for the missing planar image of the first hyperspectral image; then, performing spectral compensation processing on the second hyperspectral image to obtain a target hyperspectral image of the target sample, thereby compensating for the spectral data of the missing planar image. Therefore, the target hyperspectral image after planar image compensation processing and spectral compensation processing includes the complete planar image of the target sample and all spectral data, thereby improving the imaging accuracy of the hyperspectral image. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 It is an application environment diagram of the hyperspectral imaging method in an embodiment;
[0075] Figure 2 It is an application environment diagram of the hyperspectral imaging method in another embodiment;
[0076] Figure 3 It is a schematic flowchart of the hyperspectral imaging method in an embodiment;
[0077] Figure 4 It is a schematic flowchart of the method for obtaining a target hyperspectral image in an embodiment;
[0078] Figure 5 It is a schematic flowchart of the method for obtaining a second hyperspectral image in an embodiment;
[0079] Figure 6 It is a schematic flowchart of the method for obtaining the imaging accuracy and the initial displacement rate in an embodiment;
[0080] Figure 7It is a structural block diagram of a hyperspectral imaging device in an embodiment;
[0081] Figure 8 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0082] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0083] The hyperspectral imaging method provided by the embodiments of the present application can be applied to a terminal, which can be a terminal with hyperspectral imaging function, such as a hyperspectral imaging system. As Figure 1 shown, it is an application environment diagram of a hyperspectral imaging system provided by the embodiments of the present application. Among them, the hyperspectral imaging system includes a sample displacement platform 102, a compensation camera 104, a hyperspectral camera 106, and a processor 108. The processor 108 is electrically connected to the sample displacement platform 102, the compensation camera 104, and the hyperspectral camera 106 respectively. It can be understood that Figure 1 it is only used to illustrate the connection relationship between the devices in the hyperspectral imaging system and does not limit the relative position relationship between the devices in the hyperspectral imaging system. Among them, Figure 1 the solid arrows represent electrical connections, and the dashed arrows represent optical connections. In one embodiment, as Figure 2 shown, the hyperspectral imaging system further includes an objective lens 204, a beam splitter 204, and a mirror 208. The hyperspectral camera 106 includes a slit, a collimating lens, a grating, a focusing lens, and a grayscale camera. Among them, the solid lines represent electrical connections, and the dashed lines represent optical paths. The target sample or the target test sample is placed on the sample displacement platform 102. Therefore, during the displacement of the sample displacement platform 102, the target sample or the target test sample will also move with the sample displacement platform 102.
[0084] The processor 108 controls the sample displacement platform 102 to displace at the preset target displacement rate. During the displacement of the sample displacement platform 102 (with the target sample placed thereon) at the target displacement rate, the hyperspectral camera 106 captures the target sample at the preset first capture rate to obtain multiple first planar images. Each first planar pixel in the first planar image contains hyperspectral data. In one embodiment, the first capture rate is the maximum frame rate of the hyperspectral camera 106. The hyperspectral camera 106 sends each first planar image to the processor 108, and the processor 108 performs spectral imaging based on all the first planar images and the hyperspectral data corresponding to the first planar images to obtain a first hyperspectral image. During the displacement of the sample displacement platform 102 (with the target sample placed thereon) at the target displacement rate, the compensation camera 104 captures the target sample at the preset second capture rate to obtain multiple second planar images of the target sample. The second planar images do not contain hyperspectral data. The compensation camera 104 sends each second planar image to the processor 108, and the processor 108 performs reconstruction processing based on all the second planar images to obtain a target planar image containing the entire target sample. It can be understood that the target planar image contains all the planar images of the target sample. The processor 108 performs planar image compensation processing on the first hyperspectral image based on the target planar image to obtain a second hyperspectral image. The processor 108 performs spectral compensation processing on the second hyperspectral image to obtain the target hyperspectral image of the target sample. The target hyperspectral image contains all the planar images of the target sample and all the hyperspectral data of the target sample.
[0085] In one embodiment, as Figure 3 shown, a hyperspectral imaging method is provided. Taking the hyperspectral imaging system in Figure 1 as an example, the method includes the following steps:
[0086] Step 302, perform spectral imaging processing based on the first planar images obtained by image acquisition of the target sample by the hyperspectral camera and the hyperspectral data corresponding to the first planar images to obtain a first hyperspectral image.
[0087] The target sample is placed on the sample displacement platform, and the sample displacement platform displaces at the target displacement rate.
[0088] In the embodiment of the present application, the processor 108 controls the sample displacement platform 102 to displace at the preset target displacement rate. During the displacement of the sample displacement platform 102 at the target displacement rate, the hyperspectral camera 106 acquires images of the target sample at the preset first shooting rate, obtaining multiple first planar images. Among them, the target sample is placed on the sample displacement platform 102. Each pixel in the first planar image contains the hyperspectral data of the target sample and the planar image data of the target sample. In one embodiment, the first shooting rate is the maximum frame rate of the hyperspectral camera 106. The hyperspectral camera 106 sends all the first planar images containing hyperspectral data acquired to the processor 108. The processor 108 performs spectral imaging processing based on all the first planar images and the hyperspectral data contained in the first planar images, obtaining the first hyperspectral image of the target sample. Among them, each pixel in the first hyperspectral image contains the hyperspectral data of the target sample and the planar image data of the target sample.
[0089] Step 304: Reconstruct the second planar image obtained by the compensation camera acquiring images of the target sample to obtain a target planar image containing the target sample.
[0090] In the embodiment of the present application, the processor 108 controls the sample displacement platform 102 to displace at the preset target displacement rate. During the displacement of the sample displacement platform 102 at the target displacement rate, the compensation camera 104 acquires images of the target sample at the preset second shooting rate, obtaining multiple second planar images. Among them, the target sample is placed on the sample displacement platform 102. Each pixel in the second planar image contains the planar image data of the target sample. The compensation camera 104 sends all the second planar images acquired to the processor 108. The processor 108 performs reconstruction processing based on all the second planar images to obtain a target planar image containing the complete target sample. Among them, the target planar image contains all the planar image data of the target sample.
[0091] Step 306: Perform planar image compensation processing on the first hyperspectral image based on the target planar image to obtain a second hyperspectral image, and perform spectral compensation processing on the second hyperspectral image to obtain the target hyperspectral image of the target sample.
[0092] In an embodiment of the present application, the processor 108 compares the target planar image with the planar image of the first hyperspectral image to obtain the planar image region missing from the first hyperspectral image. The processor 108 performs planar image compensation processing on the planar image region missing from the first hyperspectral image based on the target planar image to obtain a second hyperspectral image after planar image compensation. Wherein, the second hyperspectral image contains all the planar image data of the target sample. The processor 108 performs spectral compensation processing on the planar image region missing hyperspectral data in the second hyperspectral image to obtain a target hyperspectral image after spectral compensation. Wherein, the target hyperspectral image contains all the planar image data of the target sample and all the hyperspectral data of the target sample. It can be understood that the planar image region missing hyperspectral data in the second hyperspectral image is the same as the planar image region missing from the first hyperspectral image.
[0093] In the above hyperspectral imaging method, in this solution, based on the target planar image, planar image compensation processing is performed on the first hyperspectral image to obtain a second hyperspectral image, thereby compensating for the missing planar image of the first hyperspectral image; then, spectral compensation processing is performed on the second hyperspectral image to obtain the target hyperspectral image of the target sample, thereby compensating for the spectral data of the missing planar image. Therefore, the target hyperspectral image after planar image compensation processing and spectral compensation processing contains the complete planar image of the target sample and all spectral data, thereby improving the imaging accuracy of the target hyperspectral image.
[0094] In one embodiment, as Figure 4 shown, performing spectral compensation processing on the second hyperspectral image to obtain the target hyperspectral image of the target sample includes:
[0095] Step 402, for each compensated planar pixel in the second hyperspectral image, determine the hyperspectral pixel closest to the compensated planar pixel according to the compensated planar pixel to obtain a compensated hyperspectral pixel.
[0096] Wherein, the compensated planar pixel is a pixel missing hyperspectral data. The hyperspectral pixel is a pixel containing planar image data and hyperspectral data.
[0097] In an embodiment of the present application, the processor 108 identifies a planar image region lacking hyperspectral data in the second hyperspectral image (referred to as a spectral compensation image region for convenience of distinction), and uses the pixels in the spectral compensation image region as compensation planar pixels. For each compensation planar pixel in the second hyperspectral image, the processor 108 obtains the position of the compensation planar pixel in the second hyperspectral image, and based on this position, finds the pixel containing hyperspectral data that is closest to the compensation planar pixel (i.e., the hyperspectral pixel), and uses the hyperspectral pixel closest to the compensation planar pixel as the compensation hyperspectral pixel for this compensation planar pixel. It can be understood that each compensation planar pixel has a corresponding compensation hyperspectral pixel, and the compensation hyperspectral pixels of different compensation planar pixels can be the same or different.
[0098] Step 404: Based on the hyperspectral data in the compensation hyperspectral pixels, perform spectral compensation processing on the compensation planar pixels corresponding to the compensation hyperspectral pixels to obtain the target hyperspectral image of the target sample.
[0099] In an embodiment of the present application, for each compensation planar pixel in the second hyperspectral image, the processor 108 obtains the hyperspectral data in the compensation hyperspectral pixel corresponding to this compensation planar pixel, and based on the hyperspectral data in this compensation hyperspectral pixel, performs spectral compensation processing on the compensation planar pixel to obtain a compensation planar pixel after spectral compensation. Specifically, the processor 108 uses the hyperspectral data in the compensation hyperspectral pixel as the hyperspectral data of the compensation planar pixel corresponding to this compensation hyperspectral pixel to obtain a compensation planar pixel after spectral compensation. It can be understood that the compensation planar pixel after spectral compensation includes planar image data and hyperspectral data. After the processor 108 performs spectral compensation processing on all the compensation planar pixels in the second hyperspectral image, the target hyperspectral image of the target sample is obtained. Among them, the target hyperspectral image includes all the planar image data of the target sample and all the hyperspectral data of the target sample.
[0100] In this embodiment, the terminal obtains the target hyperspectral image of the target sample by performing spectral compensation processing on the second hyperspectral image. Since the target hyperspectral image includes all the planar image data and all the hyperspectral data of the target sample, the imaging accuracy of the target hyperspectral image is improved by this solution.
[0101] In one embodiment, as Figure 5 shown, performing planar image compensation processing on the first hyperspectral image based on the target planar image to obtain the second hyperspectral image includes:
[0102] Step 502: Overlap the target planar image with the first hyperspectral image, and in the target planar image, determine the image region that does not overlap with the first hyperspectral image to obtain the target compensation image region.
[0103] In the embodiment of the present application, the processor 108 identifies whether the direction of the target planar image is consistent with the direction of the first hyperspectral image. When the direction of the target planar image is inconsistent with the direction of the first hyperspectral image, the processor 108 rotates the target planar image or the first hyperspectral image until the direction of the target planar image is consistent with the direction of the first hyperspectral image. When the direction of the target planar image is consistent with the direction of the first hyperspectral image, the processor 108 performs alignment and overlapping processing on the target planar image and the first hyperspectral image, and in the target planar image, identifies an image area that does not overlap with the first hyperspectral image. The processor 108 uses the image area in the target planar image that does not overlap with the first hyperspectral image as the target compensation image area. Each pixel in the target compensation image area contains planar image data.
[0104] Step 504: Based on the target compensation image area, perform planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image.
[0105] In the embodiment of the present application, the processor 108 performs planar image compensation processing on the first hyperspectral image based on the target compensation image area, and uses the first hyperspectral image after the planar image compensation processing as the second hyperspectral image. Specifically, the processor 108 performs alignment and overlapping processing on the target planar image and the first hyperspectral image, and in the first hyperspectral image, identifies an image area that does not overlap with the target planar image. The processor 108 uses the image area in the first hyperspectral image that does not overlap with the target planar image as the missing image area. For each missing image area in the first hyperspectral image, the processor 108 compensates the target compensation image area corresponding to the missing image area onto the missing image area. After the processor 108 performs planar image compensation processing on all the missing image areas in the first hyperspectral image, a second hyperspectral image is obtained. The second hyperspectral image contains all the planar image data of the target sample.
[0106] In this embodiment, the terminal obtains a second hyperspectral image by performing planar image compensation processing on the first hyperspectral image based on the target planar image. Since the second hyperspectral image contains all the planar image data of the target sample, and the target hyperspectral image is obtained based on the second hyperspectral image, the imaging accuracy of the hyperspectral image is improved in this solution.
[0107] In one embodiment, before obtaining the first hyperspectral image by performing spectral imaging processing on the first planar image acquired by the hyperspectral camera for the target sample and the hyperspectral data corresponding to the first planar image, it further includes:
[0108] In the test imaging accuracy of each test hyperspectral image, determine the test imaging accuracy that matches the target imaging accuracy of the target sample to obtain the reference imaging accuracy; determine the target displacement rate of the sample displacement platform according to the initial displacement rate of the sample displacement platform corresponding to the reference imaging accuracy.
[0109] Among them, the test hyperspectral image is the target hyperspectral image of the target test sample.
[0110] In the embodiment of the present application, the processor 108 finds a test sample that is the same substance as the target sample according to the substance type of the target sample, and uses the test sample that is the same substance as the target sample as the target test sample. Among them, the same substance refers to substances with the same components but different physical states. For the target test sample, the processor 108 obtains the test imaging accuracy of each test hyperspectral image and the initial displacement rate of the sample displacement platform 102 corresponding to the test imaging accuracy. The processor 108 determines the test imaging accuracy that matches the target imaging accuracy of the target sample among the test imaging accuracies based on the target imaging accuracy of the target sample to obtain the reference imaging accuracy. In the case where there is only one reference imaging accuracy, the processor ......
[0111] In this embodiment, the terminal determines the reference imaging accuracy through the target imaging accuracy of the target sample, and determines the target displacement rate of the sample displacement platform based on the reference imaging accuracy. In this way, it can ensure the imaging accuracy of the target hyperspectral image of the target sample when the sample displacement platform moves at the target displacement rate. In addition, in the case where there are multiple reference imaging accuracies, the terminal uses the reference imaging accuracy corresponding to the fastest initial displacement rate as the target displacement rate, which can also improve the target displacement rate of the sample displacement platform on the premise of ensuring the imaging accuracy of the target hyperspectral image, thereby improving the imaging efficiency of the target hyperspectral image.
[0112] In one embodiment, as Figure 6 shown, before determining the test imaging accuracy that matches the target imaging accuracy of the target sample among the test imaging accuracies of each test hyperspectral image to obtain the reference imaging accuracy, it further includes:
[0113] Step 602: Perform spectral imaging processing on the third planar image obtained by collecting an image of the target test sample using a hyperspectral camera and the hyperspectral data corresponding to the third planar image, to obtain a third hyperspectral image of the target test sample.
[0114] Among them, the target test sample is placed on the sample displacement platform, and the sample displacement platform is displaced at an initial displacement rate.
[0115] In an embodiment of the present application, the processor 108 controls the sample displacement platform 102 to be displaced at the initial displacement rate according to a preset initial displacement rate. During the process of the sample displacement platform 102 being displaced at the initial displacement rate, the hyperspectral camera 106 collects an image of the target test sample at a preset first shooting rate, to obtain multiple third planar images. Among them, the target test sample is placed on the sample displacement platform 102. Each pixel in the third planar image contains the hyperspectral data of the target test sample and the planar image data of the target test sample. In one embodiment, the first shooting rate is the maximum frame rate of the hyperspectral camera 106. The hyperspectral camera 106 sends all the collected third planar images containing hyperspectral data to the processor 108. The processor 108 performs spectral imaging processing based on all the third planar images and the hyperspectral data contained in the third planar images, to obtain a third hyperspectral image of the target test sample. Among them, each pixel in the third hyperspectral image contains the hyperspectral data of the target test sample and the planar image data of the target test sample.
[0116] Step 604: Perform reconstruction processing on the fourth planar image of the target test sample collected by the compensation camera, to obtain a target test planar image containing the target test sample.
[0117] In an embodiment of the present application, the processor 108 controls the sample displacement platform 102 to be displaced at the initial displacement rate according to a preset initial displacement rate. During the process of the sample displacement platform 102 being displaced at the initial displacement rate, the compensation camera 104 collects an image of the target test sample at a preset second shooting rate, to obtain multiple fourth planar images. Among them, the target test sample is placed on the sample displacement platform 102. Each pixel in the fourth planar image contains the planar image data of the target test sample. The compensation camera 104 sends all the collected fourth planar images to the processor 108. The processor 108 performs reconstruction processing based on all the fourth planar images, to obtain a target test planar image containing the complete target test sample. Among them, the target test planar image contains all the planar image data of the target test sample.
[0118] Step 606: Based on the target test plane image, perform plane image compensation processing on the third hyperspectral image to obtain a fourth hyperspectral image, and perform spectral compensation processing on the fourth hyperspectral image to obtain the test hyperspectral image of the target test sample.
[0119] In the embodiment of the present application, the processor 108 compares the target test plane image with the plane image of the third hyperspectral image to obtain the plane image area missing in the third hyperspectral image. The processor 108 performs plane image compensation processing on the plane image area missing in the third hyperspectral image based on the target test plane image to obtain a fourth hyperspectral image after plane image compensation. Among them, the fourth hyperspectral image contains all the plane image data of the target test sample. In one embodiment, the processor 108 identifies whether the direction of the target test plane image is consistent with the direction of the third hyperspectral image. When the direction of the target test plane image is not consistent with the direction of the third hyperspectral image, the processor 108 rotates the target test plane image or the third hyperspectral image until the direction of the target test plane image is consistent with the direction of the third hyperspectral image. When the direction of the target test plane image is consistent with the direction of the third hyperspectral image, the processor 108 performs alignment and overlapping processing on the target test plane image and the third hyperspectral image, and in the target test plane image, identifies the image area that does not overlap with the third hyperspectral image. The processor 108 uses the image area that does not overlap with the third hyperspectral image in the target test plane image as the target compensation test image area. Among them, each pixel in the target compensation test image area contains plane image data. The processor 108 performs plane image compensation processing on the third hyperspectral image based on the target compensation test image area, and uses the third hyperspectral image after plane image compensation processing as the fourth hyperspectral image. Specifically, the processor 108 performs alignment and overlapping processing on the target test plane image and the third hyperspectral image, and in the third hyperspectral image, identifies the image area that does not overlap with the target test plane image. The processor 108 uses the image area that does not overlap with the target test plane image in the third hyperspectral image as the missing test image area. For each missing test image area in the third hyperspectral image, the processor 108 compensates the target compensation test image area corresponding to the missing test image area to the missing test image area. After the processor 108 performs plane image compensation processing on all the missing test image areas in the third hyperspectral image, a fourth hyperspectral image is obtained. Among them, the fourth hyperspectral image contains all the plane image data of the target test sample.
[0120] The processor 108 performs spectral compensation processing on the planar image region lacking hyperspectral data in the fourth hyperspectral image to obtain a tested hyperspectral image after spectral compensation. The tested hyperspectral image includes all planar image data of the target test sample and all hyperspectral data of the target test sample. It can be understood that the planar image region lacking hyperspectral data in the fourth hyperspectral image is the same as the planar image region lacking in the third hyperspectral image. In one embodiment, the processor 108 identifies the planar image region lacking hyperspectral data in the fourth hyperspectral image (for the convenience of distinction, it is referred to as the spectral compensation test image region), and takes the pixels in the spectral compensation test image region as the compensated test planar pixels. For each compensated test planar pixel in the fourth hyperspectral image, the processor 108 obtains the position of the compensated test planar pixel in the fourth hyperspectral image, and finds the pixel containing hyperspectral data that is closest to the compensated test planar pixel according to this position (i.e., the hyperspectral test pixel), and takes the hyperspectral test pixel closest to the compensated test planar pixel as the compensated hyperspectral test pixel of the compensated test planar pixel. For each compensated test planar pixel in the fourth hyperspectral image, the processor 108 obtains the hyperspectral data in the corresponding compensated hyperspectral test pixel of the compensated test planar pixel, and based on the hyperspectral data in the compensated hyperspectral test pixel, performs spectral compensation processing on the compensated test planar pixel to obtain a compensated test planar pixel after spectral compensation. Specifically, the processor 108 takes the hyperspectral data in the compensated hyperspectral test pixel as the hyperspectral data of the compensated test planar pixel corresponding to the compensated hyperspectral test pixel to obtain a compensated test planar pixel after spectral compensation. It can be understood that the compensated test planar pixel after spectral compensation includes planar image data and hyperspectral data. After the processor 108 performs spectral compensation processing on all the compensated test planar pixels in the fourth hyperspectral image, it obtains the target hyperspectral image of the target test sample. The target hyperspectral image includes all planar image data of the target test sample and all hyperspectral data of the target test sample.
[0121] Step 608: According to the preset test imaging accuracy range and the test imaging accuracy of the tested hyperspectral image, re-determine the initial displacement rate, and return to execute the step of performing spectral imaging processing on the third planar image obtained by image acquisition of the target test sample by the hyperspectral camera and the hyperspectral data corresponding to the third planar image until the test imaging accuracy meets the preset stop condition, to obtain each test imaging accuracy and the initial displacement rate of the sample displacement platform corresponding to the test imaging accuracy.
[0122] Among them, the preset test imaging accuracy range includes the target imaging accuracy of the target sample.
[0123] In the embodiment of the present application, the processor 108 determines whether the test imaging accuracy of the test hyperspectral image belongs to a preset test imaging accuracy range to obtain a judgment result. The processor 108 adjusts the initial displacement rate of the sample displacement platform 102 corresponding to the test hyperspectral image according to the judgment result to obtain a new initial displacement rate. The processor returns to execute step 602 based on the new initial displacement rate until the test imaging accuracy of the test hyperspectral image meets the preset stop condition, and multiple groups of test data sets are obtained. Among them, the test data set includes the test imaging accuracy of the test hyperspectral image and the initial displacement rate of the sample displacement platform corresponding to the test imaging accuracy. The preset stop condition is that the accuracy range formed by the test imaging accuracies of the test hyperspectral images is greater than or equal to the preset test imaging accuracy range.
[0124] Specifically, it is determined whether the test imaging accuracy of the test hyperspectral image belongs to a preset test imaging accuracy range to obtain a judgment result. When the judgment result is that the test imaging accuracy of the test hyperspectral image is lower than or equal to the lower limit value of the test imaging accuracy range, the processor 108 decelerates the initial displacement rate of the sample displacement platform 102 corresponding to the test hyperspectral image to obtain a new initial displacement rate. The processor returns to execute step 602 based on the new initial displacement rate until the test imaging accuracy of the test hyperspectral image is higher than or equal to the upper limit value of the test imaging accuracy range to obtain multiple groups of test data sets. When the judgment result is that the test imaging accuracy of the test hyperspectral image is higher than or equal to the upper limit value of the test imaging accuracy range, the processor 108 accelerates the initial displacement rate of the sample displacement platform 102 corresponding to the test hyperspectral image to obtain a new initial displacement rate. The processor returns to execute step 602 based on the new initial displacement rate until the test imaging accuracy of the test hyperspectral image is lower than or equal to the lower limit value of the test imaging accuracy range to obtain multiple groups of test data sets. In one embodiment, when the judgment result is that the test imaging accuracy of the test hyperspectral image belongs to the test imaging accuracy range, the processor 108 accelerates the initial displacement rate (for the convenience of distinction, referred to as the first initial displacement rate) of the sample displacement platform 102 corresponding to the test hyperspectral image to obtain a new initial displacement rate. The processor returns to execute step 602 based on the new initial displacement rate until the test imaging accuracy of the test hyperspectral image is lower than or equal to the lower limit value of the test imaging accuracy range to obtain at least one group of test data sets. Then the processor decelerates the first initial displacement rate of the sample displacement platform 102 corresponding to the test hyperspectral image to obtain a new initial displacement rate. The processor returns to execute step 602 based on the new initial displacement rate until the test imaging accuracy of the test hyperspectral image is higher than or equal to the upper limit value of the test imaging accuracy range to obtain multiple groups of test data sets. In another embodiment, when the judgment result is that the test imaging accuracy of the test hyperspectral image belongs to the test imaging accuracy range, the processor 108 decelerates the initial displacement rate (for the convenience of distinction, referred to as the first initial displacement rate) of the sample displacement platform 102 corresponding to the test hyperspectral image to obtain a new initial displacement rate. The processor returns to execute step 602 based on the new initial displacement rate until the test imaging accuracy of the test hyperspectral image is higher than or equal to the upper limit value of the test imaging accuracy range to obtain at least one group of test data sets. Then the processor accelerates the first initial displacement rate of the sample displacement platform 102 corresponding to the test hyperspectral image to obtain a new initial displacement rate. The processor returns to execute step 602 based on the new initial displacement rate until the test imaging accuracy of the test hyperspectral image is lower than or equal to the lower limit value of the test imaging accuracy range to obtain multiple groups of test data sets.
[0125] In this embodiment, the terminal adjusts the initial displacement rate according to a preset test imaging accuracy range and the test imaging accuracy of the test hyperspectral image to obtain a new initial displacement rate. Based on the new initial displacement rate, a new test hyperspectral image is acquired until the new test hyperspectral image meets the preset stop condition, and multiple groups of test data sets are obtained. Among them, the test data set includes the test imaging accuracy of the test hyperspectral image and the initial displacement rate of the sample displacement platform corresponding to the test imaging accuracy. This solution can obtain multiple groups of test data sets, providing data support for determining the target displacement rate of the sample displacement platform.
[0126] In one embodiment, among the test imaging accuracies of each test hyperspectral image, determining the test imaging accuracy that matches the target imaging accuracy of the target sample to obtain the reference imaging accuracy includes:
[0127] According to the target imaging accuracy of the target sample, determine the imaging accuracy range including the target imaging accuracy; for the test imaging accuracy of each test hyperspectral image, when the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy, use the test imaging accuracy as the reference imaging accuracy.
[0128] In the embodiment of the present application, the processor 108 obtains the target imaging accuracy of the target sample, and based on the target imaging accuracy, calculates the imaging accuracy range including the target imaging accuracy. In one embodiment, the processor 108 calculates the sum of the target imaging accuracy and a preset accuracy error value to obtain the upper limit value of the imaging accuracy range including the target imaging accuracy (for the convenience of distinction, it is called the accuracy upper limit value); the processor 108 calculates the difference between the target imaging accuracy and the preset accuracy error value to obtain the lower limit value of the imaging accuracy range including the target imaging accuracy (for the convenience of distinction, it is called the accuracy lower limit value); the processor 108 uses the accuracy range composed of the accuracy upper limit value and the accuracy lower limit value as the imaging accuracy range. Among them, the accuracy error value is greater than or equal to 0. For the target test sample, the processor 108 obtains the test imaging accuracy of each test hyperspectral image, and for the test imaging accuracy of each test hyperspectral image, determines whether the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy. When the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy, the processor 108 uses the test imaging accuracy as the reference imaging accuracy.
[0129] In this embodiment, the terminal determines the test imaging accuracy that matches the target imaging accuracy of the target sample to obtain the reference imaging accuracy. This solution provides a premise for subsequently determining the target displacement rate of the sample displacement platform according to the reference imaging accuracy.
[0130] It should be understood that although the steps in the flowcharts involved in the above embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0131] Based on the same inventive concept, an embodiment of the present application also provides a hyperspectral imaging system for implementing the hyperspectral imaging method involved above. The implementation solutions provided by this system to solve problems are similar to the implementation solutions recorded in the above method. Therefore, the specific limitations in one or more embodiments of the hyperspectral imaging system provided below can refer to the limitations on the hyperspectral imaging method in the above text, and will not be repeated here.
[0132] In one embodiment, as Figure 1 shown, a hyperspectral imaging system is provided. The hyperspectral imaging system includes a sample displacement platform 102, a compensation camera 104, a hyperspectral camera 106, and a processor 108, where:
[0133] The sample displacement platform 102 is used to displace at a target displacement rate;
[0134] The hyperspectral camera 106 is used to collect a first planar image of the target sample and the hyperspectral data corresponding to the first planar image; wherein, the target sample is placed on the sample displacement platform 102;
[0135] The compensation camera 104 is used to collect a second planar image of the target sample;
[0136] The processor 108 is used to perform spectral imaging processing on the first planar image obtained by image acquisition of the target sample by the hyperspectral camera 106 and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image; perform reconstruction processing on the second planar image obtained by image acquisition of the target sample by the compensation camera 104 to obtain a target planar image including the target sample; perform planar image compensation processing on the first hyperspectral image based on the target planar image to obtain a second hyperspectral image, and perform spectral compensation processing on the second hyperspectral image to obtain the target hyperspectral image of the target sample.
[0137] In one embodiment, the processor 108 is specifically used for:
[0138] For each compensated planar pixel in the second hyperspectral image, determine the hyperspectral pixel closest to the compensated planar pixel according to the compensated planar pixel to obtain a compensated hyperspectral pixel;
[0139] Based on the hyperspectral data in the compensated hyperspectral pixel, perform spectral compensation processing on the compensated planar pixel corresponding to the compensated hyperspectral pixel to obtain the target hyperspectral image of the target sample.
[0140] In one embodiment, the processor 108 is specifically configured to:
[0141] Overlap the target planar image with the first hyperspectral image, and in the target planar image, determine the image area that does not overlap with the first hyperspectral image to obtain a target compensation image area;
[0142] Based on the target compensation image area, perform planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image.
[0143] In one embodiment, the processor 108 is further configured to:
[0144] Among the test imaging accuracies of each test hyperspectral image, determine the test imaging accuracy that matches the target imaging accuracy of the target sample to obtain a reference imaging accuracy;
[0145] According to the initial displacement rate of the sample displacement platform 102 corresponding to the reference imaging accuracy, determine the target displacement rate of the sample displacement platform 102.
[0146] In one embodiment, the processor 108 is further configured to:
[0147] Based on the third planar image obtained by the hyperspectral camera 106 for image acquisition of the target test sample and the hyperspectral data corresponding to the third planar image, perform spectral imaging processing to obtain the third hyperspectral image of the target test sample; wherein, the target test sample is placed on the sample displacement platform 102, and the sample displacement platform 102 is displaced at the initial displacement rate;
[0148] Based on the fourth planar image obtained by the compensation camera 104 for image acquisition of the target test sample, perform reconstruction processing to obtain a target test planar image including the target test sample;
[0149] Based on the target test planar image, perform planar image compensation processing on the third hyperspectral image to obtain a fourth hyperspectral image, and perform spectral compensation processing on the fourth hyperspectral image to obtain the test hyperspectral image of the target test sample;
[0150] According to the preset test imaging accuracy range and the test imaging accuracy of the test hyperspectral image, re-determine the initial displacement rate, and return to the step of performing spectral imaging processing on the third plane image obtained by performing image acquisition on the target test sample based on the hyperspectral camera 106 and the hyperspectral data corresponding to the third plane image, until the test imaging accuracy meets the preset stop condition, to obtain each test imaging accuracy and the initial displacement rate of the sample displacement platform 102 corresponding to the test imaging accuracy.
[0151] In one embodiment, the processor 108 is specifically configured to:
[0152] Determine an imaging accuracy range including the target imaging accuracy according to the target imaging accuracy of the target sample;
[0153] For the test imaging accuracy of each test hyperspectral image, in the case where the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy, use the test imaging accuracy as the reference imaging accuracy.
[0154] Based on the same inventive concept, an embodiment of the present application further provides a hyperspectral imaging device for implementing the above-mentioned hyperspectral imaging method. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the hyperspectral imaging device provided below can refer to the limitations on the hyperspectral imaging method in the above text, and will not be repeated here.
[0155] In one embodiment, as Figure 7 shown, a hyperspectral imaging device is provided, including:
[0156] A first determination module 702, configured to perform spectral imaging processing on the first plane image obtained by performing image acquisition on the target sample based on the hyperspectral camera and the hyperspectral data corresponding to the first plane image, to obtain a first hyperspectral image; wherein, the target sample is placed on the sample displacement platform, and the sample displacement platform is displaced at the target displacement rate;
[0157] A second determination module 704, configured to perform reconstruction processing on the second plane image obtained by performing image acquisition on the target sample based on the compensation camera, to obtain a target plane image including the target sample;
[0158] A first compensation module 706, configured to perform plane image compensation processing on the first hyperspectral image based on the target plane image, to obtain a second hyperspectral image, and perform spectral compensation processing on the second hyperspectral image, to obtain the target hyperspectral image of the target sample.
[0159] In one embodiment, the first compensation module 706 is specifically configured to:
[0160] For each compensated planar pixel in the second hyperspectral image, determine the hyperspectral pixel closest to the compensated planar pixel according to the compensated planar pixel to obtain a compensated hyperspectral pixel;
[0161] Based on the hyperspectral data in the compensated hyperspectral pixel, perform spectral compensation processing on the compensated planar pixel corresponding to the compensated hyperspectral pixel to obtain the target hyperspectral image of the target sample.
[0162] In one embodiment, the first compensation module 706 is specifically configured to:
[0163] Overlap the target planar image with the first hyperspectral image, and in the target planar image, determine the image area that does not overlap with the first hyperspectral image to obtain a target compensation image area;
[0164] Based on the target compensation image area, perform planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image.
[0165] In one embodiment, the hyperspectral imaging device further includes:
[0166] A third determination module, configured to determine the test imaging accuracy that matches the target imaging accuracy of the target sample among the test imaging accuracies of each test hyperspectral image to obtain a reference imaging accuracy;
[0167] A fourth determination module, configured to determine the target displacement rate of the sample displacement platform according to the initial displacement rate of the sample displacement platform corresponding to the reference imaging accuracy.
[0168] In one embodiment, the hyperspectral imaging device further includes:
[0169] A fifth determination module, configured to perform spectral imaging processing on the third planar image obtained by the hyperspectral camera for image acquisition of the target test sample and the hyperspectral data corresponding to the third planar image to obtain a third hyperspectral image of the target test sample; wherein, the target test sample is placed on the sample displacement platform, and the sample displacement platform is displaced at the initial displacement rate;
[0170] A sixth determination module, configured to perform reconstruction processing on the fourth planar image obtained by the compensation camera for image acquisition of the target test sample to obtain a target test planar image including the target test sample;
[0171] A second compensation module, configured to perform planar image compensation processing on the third hyperspectral image based on the target test planar image to obtain a fourth hyperspectral image, and perform spectral compensation processing on the fourth hyperspectral image to obtain a test hyperspectral image of the target test sample;
[0172] A loop module, configured to re-determine an initial displacement rate according to a preset test imaging accuracy range and the test imaging accuracy of a test hyperspectral image, and return steps of performing spectral imaging processing on a third plane image obtained by performing image acquisition on a target test sample based on a hyperspectral camera and hyperspectral data corresponding to the third plane image, until the test imaging accuracy meets a preset stop condition, so as to obtain each test imaging accuracy and the initial displacement rate of the sample displacement platform corresponding to the test imaging accuracy.
[0173] In one embodiment, the third determination module is specifically configured to:
[0174] Determine an imaging accuracy range including the target imaging accuracy according to the target imaging accuracy of the target sample;
[0175] For the test imaging accuracy of each test hyperspectral image, when the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy, use the test imaging accuracy as a reference imaging accuracy.
[0176] Each module in the above hyperspectral imaging device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0177] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 8 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through 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 to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor, implements a hyperspectral imaging 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 covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0178] [[ID=$$]]Those skilled in the art can understand, Figure 8The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0179] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0180] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0181] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0182] 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 this application are all information and data authorized by the user or fully authorized by all parties.
[0183] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include Read-Only Memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0184] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0185] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A hyperspectral imaging method, characterized in that, The method is applied to a hyperspectral imaging system, which includes a sample displacement platform, a compensation camera, and a hyperspectral camera. The method includes: Performing spectral imaging processing on a first planar image obtained by image acquisition of a target sample by the hyperspectral camera and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image; wherein, the target sample is placed on the sample displacement platform, and the sample displacement platform is displaced at a target displacement rate; Performing reconstruction processing on a second planar image obtained by image acquisition of the target sample by the compensation camera to obtain a target planar image including the target sample; Based on the target planar image, performing planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image, and performing spectral compensation processing on the second hyperspectral image to obtain a target hyperspectral image of the target sample.
2. The method according to claim 1, characterized in that, The performing spectral compensation processing on the second hyperspectral image to obtain a target hyperspectral image of the target sample includes: For each compensated planar pixel in the second hyperspectral image, determining a hyperspectral pixel closest to the compensated planar pixel according to the compensated planar pixel to obtain a compensated hyperspectral pixel; Based on the hyperspectral data in the compensated hyperspectral pixels, performing spectral compensation processing on the compensated planar pixels corresponding to the compensated hyperspectral pixels to obtain a target hyperspectral image of the target sample.
3. The method according to claim 1, wherein The based on the target planar image, performing planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image includes: Performing an overlapping process on the target planar image and the first hyperspectral image, and in the target planar image, determining an image area that does not overlap with the first hyperspectral image to obtain a target compensation image area; Based on the target compensation image area, performing planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image.
4. The method according to claim 1, wherein Before the performing spectral imaging processing on a first planar image obtained by image acquisition of a target sample by the hyperspectral camera and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image, it further includes: Among the test imaging accuracies of each test hyperspectral image, determining a test imaging accuracy that matches the target imaging accuracy of the target sample to obtain a reference imaging accuracy; According to the initial displacement rate of the sample displacement platform corresponding to the reference imaging accuracy, determining the target displacement rate of the sample displacement platform.
5. The method according to claim 4, wherein Before the among the test imaging accuracies of each test hyperspectral image, determining a test imaging accuracy that matches the target imaging accuracy of the target sample to obtain a reference imaging accuracy, it further includes: Performing spectral imaging processing on a third planar image obtained by image acquisition of a target test sample by the hyperspectral camera and the hyperspectral data corresponding to the third planar image to obtain a third hyperspectral image of the target test sample; wherein, the target test sample is placed on the sample displacement platform, and the sample displacement platform is displaced at an initial displacement rate; Performing reconstruction processing on the fourth planar image obtained by acquiring an image of the target test sample using the compensation camera to obtain a target test planar image including the target test sample; Based on the target test planar image, performing planar image compensation processing on the third hyperspectral image to obtain a fourth hyperspectral image, and performing spectral compensation processing on the fourth hyperspectral image to obtain the test hyperspectral image of the target test sample; According to a preset test imaging accuracy range and the test imaging accuracy of the test hyperspectral image, re-determining the initial displacement rate, and returning to execute the step of performing spectral imaging processing on the third planar image obtained by acquiring an image of the target test sample using the hyperspectral camera and the hyperspectral data corresponding to the third planar image until the test imaging accuracy meets the preset stop condition, to obtain each of the test imaging accuracies and the initial displacement rate of the sample displacement platform corresponding to the test imaging accuracy; 6. The method according to claim 4, characterized in that, Determining, among the test imaging accuracies of each test hyperspectral image, a test imaging accuracy that matches the target imaging accuracy of the target sample to obtain a reference imaging accuracy includes: According to the target imaging accuracy of the target sample, determining an imaging accuracy range including the target imaging accuracy; For the test imaging accuracy of each test hyperspectral image, in the case where the test imaging accuracy belongs to the imaging accuracy range including the target imaging accuracy, using the test imaging accuracy as the reference imaging accuracy.
7. A hyperspectral imaging system, the hyperspectral imaging system includes a sample displacement platform, a compensation camera, a hyperspectral camera, and a processor, wherein: The sample displacement platform is configured to displace at a target displacement rate; The hyperspectral camera is configured to acquire a first planar image of the target sample and the hyperspectral data corresponding to the first planar image; wherein, the target sample is placed on the sample displacement platform; The compensation camera is configured to acquire a second planar image of the target sample; The processor is configured to perform spectral imaging processing on the first planar image obtained by acquiring an image of the target sample using the hyperspectral camera and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image; perform reconstruction processing on the second planar image obtained by acquiring an image of the target sample using the compensation camera to obtain a target planar image including the target sample; based on the target planar image, perform planar image compensation processing on the first hyperspectral image to obtain a second hyperspectral image, and perform spectral compensation processing on the second hyperspectral image to obtain the target hyperspectral image of the target sample.
8. A hyperspectral imaging device, characterized in that, The device includes: A first determination module, configured to perform spectral imaging processing on the first planar image obtained by acquiring an image of the target sample using the hyperspectral camera and the hyperspectral data corresponding to the first planar image to obtain a first hyperspectral image; wherein, the target sample is placed on the sample displacement platform, and the sample displacement platform displaces at a target displacement rate; A second determination module, configured to perform reconstruction processing on a second planar image obtained by image acquisition of the target sample by a compensation camera, so as to obtain a target planar image including the target sample; A first compensation module, configured to perform planar image compensation processing on the first hyperspectral image based on the target planar image to obtain a second hyperspectral image, and perform spectral compensation processing on the second hyperspectral image to obtain a target hyperspectral image of the target sample.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Hyper-spectral imaging system based on hyper-spectral camera and area-array camera as well as POS system
CN108051407A
Systems, Devices, and Methods for Hyperspectral Imaging
US20210348966A1