Infrared spectrum image generation method and device based on parallel computing and electronic equipment
Through parallel computing methods, spectral data of multiple storage channels are cached and processed to generate infrared spectral images, solving the problem of low computing efficiency in the prior art and improving the generation efficiency of infrared spectral images.
Patent Information
- Application Number
- CN202510335267.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, the calculation efficiency is low during the generation process of infrared spectral image, resulting in a decrease in the efficiency of obtaining infrared spectral images.
The parallel calculation method is used to obtain the spectral data corresponding to multiple continuous wavelengths of the target thermal model and cache it in multiple storage channels. Each storage channel stores multiple spectral data of different wavelengths, and calculates the spectral data of each storage channel in parallel to generate infrared spectral radiation brightness, thereby generating infrared spectral images.
The calculation efficiency of obtaining the target infrared spectral radiation brightness at different wavelengths is improved, the rendering delay of infrared spectral images is reduced, and the generation efficiency of infrared spectral images is improved.
Smart Images

Figure CN120235976A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to an infrared spectral image generation method, apparatus, and electronic device based on parallel computing. Background Art
[0002] Infrared spectrum refers to that molecules can selectively absorb infrared rays of certain wavelengths, thereby causing transitions of vibrational energy levels and rotational energy levels in the molecules. By detecting the absorption of infrared rays, the infrared absorption spectrum of the target thermal model can be obtained. Infrared spectrum is also called molecular vibration spectrum or vibration-rotation spectrum infrared spectrum data. Currently, it plays a crucial role in the development of infrared multi-spectral imaging detection instruments and the analysis of target background spectral characteristics.
[0003] In the prior art, an infrared scene simulation can be performed by a physical offline renderer using a ray tracing algorithm to obtain infrared spectrum data, and then an infrared spectral image is generated. However, when using the prior art to perform infrared spectrum simulation and obtain infrared spectrum data, since it is a serial calculation using a central processing unit (CPU) or a single-channel GPU renders infrared spectrum data, there is a problem of low calculation efficiency, which reduces the efficiency of obtaining an infrared spectral image. Summary of the Invention
[0004] Based on this, it is necessary to provide an infrared spectral image generation method, apparatus, and electronic device based on parallel computing for the above technical problems.
[0005] In a first aspect, an embodiment of the present invention provides an infrared spectral image generation method based on parallel computing, the method including:
[0006] Obtain spectral data corresponding to a target thermal model at multiple consecutive wavelengths, and cache the multiple spectral data into multiple storage channels, where each storage channel stores spectral data of multiple different wavelengths;
[0007] Parallelly calculate the spectral data of multiple different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiance;
[0008] Generate and display an infrared spectral image of the target thermal model based on the multiple target infrared spectral radiance and the multiple spectral data.
[0009] In one embodiment, the caching the multiple spectral data into multiple storage channels includes:
[0010] For the spectral data corresponding to multiple consecutive wavelengths, sort the wavelengths of the multiple consecutive wavelengths, and sequentially and cyclically store the spectral data corresponding to one wavelength into one storage channel until all the spectral data are cached into the storage channel.
[0011] In one embodiment, the spectral data at least includes: the first spectral data corresponding to the target thermal model and the second spectral data of the atmosphere. The parallel computing of the spectral data of multiple different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiance includes:
[0012] According to the first spectral data, determine the target radiance of the target thermal model at each wavelength;
[0013] According to the target radiance and the second spectral data, determine the target infrared spectral radiance of the target thermal model at each wavelength.
[0014] In one embodiment, the first spectral data includes: temperature and emissivity. The determining of the target radiance of the target thermal model at each wavelength according to the first spectral data includes:
[0015] Substitute the temperature and wavelength into the Planck blackbody radiation formula to calculate the exitance of the target thermal model;
[0016] According to the exitance and the emissivity, determine the target radiance.
[0017] In one embodiment, the second spectral data includes: atmospheric spectral transmittance, path radiance value, and sky background radiation texture value; the determining of the target infrared spectral radiance of the target thermal model at each wavelength according to the target radiance and the second spectral data includes:
[0018] Substitute the target radiance, the atmospheric spectral transmittance, the path radiance value, and the sky background radiation texture value into a preset infrared spectral radiance function to calculate the target infrared spectral radiance;
[0019] Wherein, the preset infrared spectral radiance function can be defined by the following expression:
[0020] R total (λ) = M(λ) * T L (λ) + R Lpath (λ) + R bg (λ)
[0021] Wherein, M(λ) represents the target radiance at wavelength λ, T L (λ) represents the atmospheric spectral transmittance at wavelength λ, R LpathThe path radiation value at wavelength λ is denoted as (λ), and R bg The sky background radiation texture value at wavelength λ is denoted as (λ), L represents the distance between the target thermal model and the infrared detector, (x1, y1, z1) represents the spatial coordinates corresponding to the target thermal model, and (x2, y2, z2) represents the spatial coordinates corresponding to the infrared detector.
[0022] In one embodiment, the first spectral data further includes: the world coordinates of the target thermal model. Generating and displaying an infrared spectral image of the target thermal model based on the multiple target infrared spectral radiance and the multiple spectral data includes:
[0023] According to the world coordinates, determine the target positions of the respective pixel points of the infrared spectral image to be displayed on the display device through a vertex shader;
[0024] According to the target infrared spectral radiance, determine the pixel radiance values of the respective pixel points corresponding to the target positions through a fragment shader;
[0025] Display the infrared spectral image of the target thermal model according to the target positions and the pixel radiance values.
[0026] In one embodiment, the method further includes:
[0027] Obtain the infrared spectral radiance corresponding to a preset band according to the target infrared spectral radiance corresponding to multiple consecutive wavelengths.
[0028] In one embodiment, the method further includes:
[0029] Determine multiple storage channels according to the RGBA channels corresponding to the target thermal model.
[0030] In a second aspect, an infrared spectral image generation device based on parallel computing provided by an embodiment of the present invention includes:
[0031] A spectral data acquisition module, configured to acquire spectral data corresponding to a target thermal model at multiple consecutive wavelengths and cache the multiple spectral data into multiple storage channels, where each storage channel stores spectral data of multiple different wavelengths;
[0032] A calculation module, configured to perform parallel calculation on the spectral data of multiple different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiance;
[0033] A generation and display module, configured to generate and display an infrared spectral image of the target thermal model based on the multiple target infrared spectral radiance and the multiple spectral data.
[0034] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor. The memory stores a computer program. It is characterized in that when the processor executes the computer program, the steps of the infrared spectrum image generation method based on parallel computing described in the first aspect are implemented.
[0035] The technical solution provided by the embodiment of the present invention has the following advantages compared with the prior art:
[0036] For an infrared spectrum image generation method based on parallel computing provided by an embodiment of the present invention, in this way, by acquiring spectral data corresponding to a target thermal model at multiple consecutive wavelengths respectively, and caching the multiple spectral data into multiple storage channels, wherein each storage channel stores spectral data of multiple different wavelengths. Parallelly calculate the spectral data of multiple different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiance. Based on the multiple target infrared spectral radiance and the multiple spectral data, generate and display an infrared spectrum image of the target thermal model. By using this way, it is possible to simultaneously and parallelly calculate the spectral data of multiple different wavelengths of the target thermal model cached in multiple storage channels, thereby improving the calculation efficiency of obtaining the target infrared spectral radiance at different wavelengths, reducing the rendering delay of subsequently generating the infrared spectrum image of the target thermal model, and improving the efficiency of obtaining the infrared spectrum image. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0039] Figure 1 It is a schematic flowchart of an infrared spectrum image generation method based on parallel computing provided by an embodiment of the present invention;
[0040] Figure 2 It is a schematic diagram of rendering infrared spectrum data through a single-channel GPU in the prior art provided by an embodiment of the present invention;
[0041] Figure 3 It is a schematic diagram of a scenario where spectral data corresponding to different consecutive wavelengths is cached in a vec4 (thought vector) channel provided by an embodiment of the present invention;
[0042] Figure 4A schematic diagram of calculating, rendering, and displaying multiple frames of infrared spectral images using a triple buffer provided by an embodiment of the present invention;
[0043] Figure 5 A schematic diagram of the structure of an infrared spectral image generation device based on parallel computing provided by an embodiment of the present invention. Detailed implementation manners
[0044] In order to more clearly understand the above objects, features, and advantages of the present invention, the solutions of the present invention will be further described below. It should be noted that, without conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.
[0045] In the following description, many specific details are set forth to fully understand the present invention, but the present invention can also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present invention, rather than all the embodiments.
[0046] Infrared spectrum refers to that molecules can selectively absorb infrared rays of certain wavelengths, thereby causing transitions of vibrational energy levels and rotational energy levels in the molecules. By detecting the absorption of infrared rays, the infrared absorption spectrum of the target thermal model can be obtained. Infrared spectrum is also called molecular vibration spectrum or vibration-rotation spectrum infrared spectrum data. Currently, it plays a crucial role in the development of infrared multi-spectral imaging detection instruments and the analysis of target background spectral characteristics.
[0047] In the prior art, an infrared scene simulation can be performed through a physical offline renderer using a ray tracing algorithm to obtain infrared spectrum data, thereby generating an infrared spectral image. However, when performing infrared spectrum simulation and obtaining infrared spectrum data using the prior art, since it is a serial calculation using a central processing unit (CPU), or, as shown in Figure 2 calculating and rendering infrared spectrum data through a single-channel GPU, there is a problem of low calculation efficiency, which reduces the efficiency of obtaining an infrared spectral image.
[0048] Therefore, the present invention provides an infrared spectral image generation method based on parallel computing. By acquiring spectral data corresponding to a target thermal model at multiple consecutive wavelengths and caching the multiple spectral data into multiple storage channels, where each storage channel stores spectral data of multiple different wavelengths. Parallelly compute the spectral data of multiple different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiance. Generate and display an infrared spectral image of the target thermal model based on the multiple target infrared spectral radiance and the multiple spectral data. By adopting this method, it is possible to simultaneously and parallelly compute the spectral data of the target thermal model at multiple different wavelengths cached in multiple storage channels, thereby improving the computing efficiency of obtaining the target infrared spectral radiance at different wavelengths, reducing the rendering delay of the subsequent generation of the infrared spectral image of the target thermal model, and improving the efficiency of obtaining the infrared spectral image.
[0049] In one embodiment, as Figure 1 shown, Figure 1 is a schematic flowchart of an infrared spectral image generation method based on parallel computing provided by an embodiment of the present invention, which specifically includes the following steps:
[0050] S10: Acquire spectral data corresponding to a target thermal model at multiple consecutive wavelengths, and cache the multiple spectral data into multiple storage channels.
[0051] Among them, the target thermal model refers to the target object photographed by an infrared detector. The target thermal model can be an obj model obtained through simulation by computer-aided engineering software such as Ansys. Multiple consecutive wavelengths form a band. Exemplarily, for a preset band of 3um - 5um, it includes multiple consecutive wavelengths such as λ1: 3.1um, λ2: 3.2um, λ3: 3.3um, λ4: 3.4um... λ 20 : 5um, but not limited thereto. The present invention does not specifically limit it, and those skilled in the art can set it according to the actual situation.
[0052] The above storage channels are used to store spectral data, and each storage channel stores spectral data of multiple different wavelengths. Exemplarily, continuing with the above embodiment, assuming there are two storage channels, then in one storage channel, store multiple consecutive different wavelength spectral data between λ1 and λ 10 and in the second storage channel, store multiple consecutive different wavelength spectral data between λ 11 and λ 20 . It can be understood that the spectral data of each different wavelength is only cached into one storage channel.
[0053] Optionally, a way to determine multiple storage channels can be: Determine multiple storage channels according to the RGBA channels corresponding to the target thermal model.
[0054] Among them, the RGBA channels are the channels in vec4 (four-dimensional vector). For vec4, it is a four-dimensional vector type in the OpenGL Shading Language (GLSL). Since GLSL is a language that can write shader (vertex shader and fragment shader) programs in OpenGL, based on this, the RGBA channels, namely the channels of the vec4 (four-dimensional vector) corresponding to Red, Green, Blue, and Alpha, can be used as the storage channels for storing spectral data, which is convenient for subsequent rendering of infrared spectral images.
[0055] Specifically, for the target thermal model, obtain the spectral data corresponding to the target thermal model at multiple consecutive wavelengths, and cache the multiple spectral data into multiple storage channels. For each storage channel, store the spectral data at multiple different wavelengths.
[0056] Optionally, based on the above embodiments, in some embodiments of the present invention, one implementation manner of caching the multiple spectral data into multiple storage channels can be:
[0057] For the spectral data corresponding to multiple consecutive wavelengths, according to the wavelength sorting of the multiple consecutive wavelengths, sequentially and cyclically store the spectral data corresponding to one wavelength into one storage channel until all the spectral data are cached into the storage channels.
[0058] Exemplarily, as shown in Figure 3 For multiple consecutive wavelengths such as λ1, λ2, λ3, λ4...λ 16 , among the four storage channels in vec4 (four-dimensional vector), according to the wavelength sorting of the multiple consecutive wavelengths, that is, the wavelength sorting of λ1, λ2, λ3, λ4...λ 16 , sequentially cache the spectral data corresponding to λ1 into the first storage channel corresponding to vec4 (four-dimensional vector), cache the spectral data corresponding to λ2 into the second storage channel corresponding to vec4 (four-dimensional vector), cache the spectral data corresponding to λ3 into the third storage channel corresponding to vec4 (four-dimensional vector), and cache the spectral data corresponding to λ4 into the fourth storage channel corresponding to vec4 (four-dimensional vector) to end the first round of storage. Then, cyclically cache the spectral data corresponding to λ5, λ6, λ7, λ8 into the four channels in vec4 (four-dimensional vector) until all the spectral data corresponding to the multiple consecutive wavelengths are cached into the storage channels to end the caching. However, this is not limited thereto, and the present invention does not specifically limit it, and those skilled in the art can set it according to the actual situation.
[0059] In this way, this embodiment can cache the spectral data corresponding to multiple consecutive wavelengths obtained into multiple storage channels, so as to facilitate subsequent parallel calculation of the spectral data stored in the multiple storage channels, thereby shortening the calculation time and improving the calculation efficiency.
[0060] S11: Parallelly calculate the spectral data of multiple different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiance.
[0061] Specifically, parallelly calculate the spectral data of multiple different wavelengths stored in multiple storage channels to obtain the target infrared spectral radiance corresponding to each of the multiple different wavelengths.
[0062] Optionally, on the basis of the above embodiment, in some embodiments of the present invention, before executing S11, load the spectral data of the target thermal model at multiple different wavelengths in multiple storage channels through the Assimp library function.
[0063] Optionally, one implementation method for parallel calculation can be to call a thread on each core of the GPU for each storage channel and use multiple threads to perform parallel calculation simultaneously.
[0064] Optionally, on the basis of the above embodiment, in some embodiments of the present invention, the spectral data at least includes: the first spectral data corresponding to the target thermal model and the second spectral data of the atmosphere. Based on this, one implementation method of S11 can be:
[0065] S111: Determine the target radiance of the target thermal model at each wavelength according to the first spectral data.
[0066] Specifically, for the target thermal model, use the first spectral data corresponding to the target thermal model to determine the target radiance of the target thermal model at each wavelength.
[0067] Optionally, on the basis of the above embodiment, in some embodiments of the present invention, the first spectral data includes: temperature and emissivity, where the temperature refers to the temperature corresponding to multiple vertex positions when establishing the target thermal model. Based on this, one implementation method of S111 can be:
[0068] S1111: Substitute the temperature and wavelength into the Planck blackbody radiation formula to calculate the exitance of the target thermal model.
[0069] Among them, the Planck blackbody radiation formula refers to the relationship between the radiant emittance of electromagnetic radiation emitted from a blackbody and the frequency at any temperature T. The radiation intensity distribution of an object at different wavelengths at any temperature is described by the Planck blackbody radiation law, and the exitance of the object in different bands can be calculated.
[0070] Optionally, based on the above embodiments, in some embodiments of the present invention, the Planck blackbody radiation formula may be defined by the following expression:
[0071]
[0072] where λ represents the wavelength, T represents the absolute temperature of the blackbody, c1 represents the first radiation constant, c1 = 2πhc 2 = (3.7415 ± 0.0003) * 10 8 (W * um 4 / m 2 )), c2 represents the second radiation constant, c2 = hc / k = (1.43879 ± 0.00019) * 10 4 (um * K), h represents Planck's constant, h = 6.624 * 10 -34 Js, c represents the speed of light in vacuum, c = 3 * 10 8 m / s, k represents Boltzmann's constant, k = 1.381 * 10 -23 J / K.
[0073] S1112: Determine the target radiation luminance according to the exitance and emissivity.
[0074] Specifically, when calculating the exitance corresponding to the target thermal model at different wavelengths, determine the target radiation luminance at different wavelengths according to the exitance and the emissivity corresponding to the target thermal model.
[0075] Optionally, based on the above embodiments, in some embodiments of the present invention, substitute the exitance and emissivity into the target radiation luminance calculation formula, and calculate the target radiation luminance through the target radiation luminance calculation formula. The target radiation luminance calculation formula may be defined by the following expression: M(λ) = ε * M bb (λ), where ε represents the emissivity of the target thermal model.
[0076] S112: Determine the target infrared spectral radiation luminance of the target thermal model at each wavelength according to the target radiation luminance and the second spectral data.
[0077] Specifically, after obtaining the target radiation luminance of the target thermal model, determine the target infrared spectral radiation luminance of the target thermal model at each wavelength according to the target radiation luminance and the second spectral data of the atmosphere.
[0078] Optionally, based on the above embodiments, in some embodiments of the present invention, the second spectral data includes: atmospheric spectral transmittance, path radiation value, and sky background radiation texture value. Based on this, one implementation manner of S112 may be:
[0079] S1121: Substitute the target radiance, atmospheric spectral transmittance, path radiance value, and sky background radiation texture value into a preset infrared spectral radiance function to calculate the target infrared spectral radiance.
[0080] Specifically, substitute the target radiance, atmospheric spectral transmittance, path radiance value, and sky background radiation texture value of the obtained target thermal model into a preset infrared spectral radiance function, and calculate the target infrared spectral radiance through the preset infrared spectral radiance function.
[0081] Optionally, based on the above embodiments, in some embodiments of the present invention, the preset infrared spectral radiance function can be defined by the following expression:
[0082] R total (λ) = M(λ) * T L (λ) + R Lpath (λ) + R bg (λ)
[0083] Wherein, M(λ) represents the target radiance at wavelength λ, T L (λ) represents the atmospheric spectral transmittance at wavelength λ, R Lpath (λ) represents the path radiance value at wavelength λ, R bg (λ) represents the sky background radiation texture value at wavelength λ, L represents the distance between the target thermal model and the infrared detector, (x1, y1, z1) represents the spatial coordinates corresponding to the target thermal model, and (x2, y2, z2) represents the spatial coordinates corresponding to the infrared detector.
[0084] Optionally, based on the above embodiments, in some embodiments of the present invention, the wavelength can also be converted into wavenumber to obtain the target infrared spectral radiance at each wavenumber.
[0085] Specifically, for different wavelengths, the wavenumber corresponding to different wavelengths can be obtained according to the formula Based on this, for the target infrared spectral radiance at each wavenumber, it can be calculated according to the formula R total (k) = M(k) * T L (k) + R Lpath (k) + R bg (k).
[0086] Wherein, M(k) represents the target radiance at wavenumber k, T L (k) represents the atmospheric spectral transmittance at wavenumber k, R Lpath (k) represents the path radiance value at wavenumber k, R bg (k) represents the sky background radiation texture value at wavenumber k.
[0087] S12: Generate and display an infrared spectral image of the target thermal model based on multiple target infrared spectral radiance values and multiple spectral data.
[0088] Specifically, after obtaining multiple target infrared spectral radiance values of the target thermal model at multiple consecutive wavelengths, an infrared spectral image of the target thermal model is generated and displayed based on the multiple target infrared spectral radiance values and the multiple spectral data.
[0089] In this way, the infrared spectral image generation method based on parallel computing provided in this embodiment obtains spectral data corresponding to the target thermal model at multiple consecutive wavelengths, and caches the multiple spectral data into multiple storage channels, where each storage channel stores spectral data at multiple different wavelengths. The spectral data at multiple different wavelengths stored in each storage channel are calculated in parallel to obtain multiple target infrared spectral radiance values. An infrared spectral image of the target thermal model is generated and displayed based on the multiple target infrared spectral radiance values and the multiple spectral data. By adopting this method, the spectral data at multiple different wavelengths of the target thermal model cached in multiple storage channels can be calculated in parallel at the same time, thereby improving the calculation efficiency of obtaining the target infrared spectral radiance values at different wavelengths, reducing the rendering delay of the subsequent infrared spectral image of the target thermal model, and improving the efficiency of obtaining the infrared spectral image.
[0090] Optionally, based on the above embodiment, in some embodiments of the present invention, the first spectral data further includes: the world coordinates corresponding to the target thermal model. Based on this, one implementation manner of S12 may be:
[0091] S121: Determine the target positions of the individual pixel points included in the infrared spectral image to be displayed on the display device according to the world coordinates through a vertex shader.
[0092] S122: Determine the pixel radiance values of the individual pixel points corresponding to the target positions according to the target infrared spectral radiance through a fragment shader.
[0093] Specifically, the world coordinates corresponding to the target thermal model are converted through a vertex shader to determine the two-dimensional target positions of the individual pixel points included in the infrared spectral image to be displayed on the display device. Further, for the individual pixel points corresponding to the respective two-dimensional target positions, the pixel radiance values of the individual pixel points are obtained through a fragment shader according to the target infrared spectral radiance of the target thermal model.
[0094] S123: Display the infrared spectral image of the target thermal model according to the target positions and the pixel radiance values.
[0095] Specifically, according to the target positions and pixel radiance values of each pixel, an infrared spectral image of the target thermal model is displayed on the display device.
[0096] Optionally, based on the above embodiments, in some embodiments of the present invention, it may be to write the pixel radiance value into the color buffer through OpenGL, call the glfwSwapBuffers() function to obtain the pixel radiance value of the color buffer, and display the infrared spectral image on the display device according to the target positions of each pixel.
[0097] Optionally, based on the above embodiments, in some embodiments of the present invention, the preset band includes: a plurality of consecutive wavelengths. Based on this, the method further includes:
[0098] S13: Obtain the infrared spectral radiance corresponding to the preset band according to the target infrared spectral radiances corresponding to the plurality of consecutive wavelengths respectively.
[0099] Specifically, for the preset band, the infrared spectral radiance corresponding to the preset band can be obtained according to the target infrared spectral radiances corresponding to the plurality of consecutive wavelengths included in the preset band.
[0100] Optionally, based on the above embodiments, in some embodiments of the present invention, the infrared spectral radiance corresponding to the preset band can be calculated according to the integral formula, and the integral formula can be defined by the following expression:
[0101]
[0102] where λ i represents the i-th wavelength among the plurality of consecutive wavelengths included in the preset band, and λ j represents the j-th wavelength among the plurality of consecutive wavelengths included in the preset band.
[0103] Optionally, based on the above embodiments, in some embodiments of the present invention, the calculation, rendering, and display of the target infrared spectral radiance of multiple frames of infrared spectral images can be realized by adopting a triple buffer. Among them, the triple buffer includes: a front buffer, a back buffer, and a spare buffer.
[0104] Specifically, the current infrared spectral image frame N is displayed in the front buffer, the infrared spectral image frame N + 1 is rendered in the back buffer, and the spare buffer is used to calculate the target infrared spectral radiance of the infrared spectral image frame N + 2.
[0105] Exemplarily, referring to Figure 4As shown, the front buffer is the display showing the current infrared spectral image frame N, assumed to be A, the back buffer is the GPU rendering the infrared spectral image frame N + 1, assumed to be B, and the spare buffer is the CPU calculating the target infrared spectral radiance of the infrared spectral image frame N + 2, assumed to be C. The specific workflow is as follows: The CPU calculates the target infrared spectral radiance of the infrared spectral image frame N + 2 in the spare buffer; the GPU renders the infrared spectral image frame N + 1 in the back buffer. After the rendering is completed, the back buffer becomes the front buffer, and the rendered infrared spectral image frame N + 1 is displayed. The spare buffer becomes the back buffer, and the infrared spectral image frame N + 2 is rendered. The front buffer is restored to the spare buffer, and the target infrared spectral radiance of the next frame of the infrared spectral image is calculated, and this process is executed in a loop in this way.
[0106] In this way, this embodiment can simultaneously perform calculations, rendering, and display operations on different infrared spectral image frames through a triple buffer, improving the efficiency of generating infrared spectral images.
[0107] It should be understood that although Figures 1 to 4 the steps in the flowchart are sequentially shown according to the arrows, these steps do not necessarily execute in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figures 1 to 4 at least a part of the steps in
[0108] In one embodiment, as Figure 5 shown, a device for generating an infrared spectral image based on parallel computing is provided, including: a spectral data acquisition module 10, a calculation module 11, and a generation and display module 12.
[0109] Among them, the spectral data acquisition module 10 is used to acquire spectral data corresponding to a target thermal model at multiple consecutive wavelengths and cache the multiple spectral data into multiple storage channels, where each storage channel stores spectral data at multiple different wavelengths.
[0110] The calculation module 11 is used to perform parallel calculations on the multiple spectral data at different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiances.
[0111] A generation display module 12 is configured to generate and display an infrared spectral image of the target thermal model based on the multiple target infrared spectral radiance and the multiple spectral data.
[0112] In the above embodiment, the spectral data acquisition module acquires spectral data corresponding to the target thermal model at multiple consecutive wavelengths and caches the multiple spectral data into multiple storage channels, where each storage channel stores spectral data at multiple different wavelengths. The calculation module calculates in parallel the multiple spectral data at different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiance. The generation display module generates and displays an infrared spectral image of the target thermal model based on the multiple target infrared spectral radiance and the multiple spectral data. By adopting this method, it is possible to calculate in parallel the spectral data of the target thermal model at multiple different wavelengths cached in multiple storage channels, thereby improving the calculation efficiency of obtaining the target infrared spectral radiance at different wavelengths, reducing the rendering delay of the subsequent generation of the infrared spectral image of the target thermal model, and improving the efficiency of obtaining the infrared spectral image.
[0113] For the specific definition of the infrared spectral image generation device based on parallel calculation, reference can be made to the definition of the infrared spectral image generation method based on parallel calculation in the above text, which will not be elaborated here. Each module in the above server 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 can 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.
[0114] An embodiment of the present invention provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it can implement the infrared spectral image generation method based on parallel calculation provided by the embodiment of the present invention. For example, when the processor executes the computer program, it can implement Figures 1 to 4 the technical solutions of any of the illustrated method embodiments. The implementation principles and technical effects are similar and will not be elaborated here.
[0115] 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 by the present invention 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, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM), etc.
[0116] 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.
[0117] The above-described embodiments merely represent several implementation manners of the present invention. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the appended claims.
Claims
1. A method for generating infrared spectrum images based on parallel computing, characterized in that: include: Acquire spectral data corresponding to a target thermal model at a plurality of continuous wavelengths, and cache the plurality of spectral data into a plurality of storage channels, wherein each storage channel stores a plurality of spectral data at different wavelengths; Parallel calculation of multiple spectrum data of different wavelengths stored in each storage channel to obtain multiple target infrared spectrum radiation brightness; Based on the plurality of target infrared spectrum radiation brightness and the plurality of spectrum data, an infrared spectrum image of the target thermal model is generated and displayed.
2. The method according to claim 1, characterized in that The method further comprises: caching the plurality of spectral data into a plurality of storage channels, comprising: For the spectral data corresponding to the multiple continuous wavelengths, the spectral data corresponding to one wavelength is sequentially and cyclically stored in one storage channel according to the wavelength order of the multiple continuous wavelengths, until all the spectral data are cached in the storage channel.
3. The method according to claim 2, characterized in that The spectral data at least includes: first spectral data corresponding to the target thermal model and second spectral data of the atmosphere, and the parallel calculation of the spectral data of multiple different wavelengths stored in each storage channel to obtain multiple target infrared spectral radiation brightness includes: determining the target radiation brightness of the target thermal model at each wavelength according to the first spectrum data; The target infrared spectrum radiation brightness of the target thermal model at each wavelength is determined according to the target radiation brightness and the second spectrum data.
4. The method according to claim 3, characterized in that The first spectral data includes: temperature and emissivity, and determining the target radiation brightness of the target thermal model at each wavelength according to the first spectral data includes: Substituting the temperature and wavelength into Planck's blackbody radiation formula to calculate the emittance of the target thermal model; The target radiation brightness is determined according to the emittance and the emissivity.
5. The method according to claim 4, characterized in that The second spectral data includes: atmospheric spectral transmittance, path radiation value and sky background radiation texture value; determining the target infrared spectral radiation brightness of the target thermal model at each wavelength according to the target radiation brightness and the second spectral data includes: Substituting the target radiation brightness, the atmospheric spectrum transmittance, the path radiation value and the sky background radiation texture value into a preset infrared spectrum radiation brightness function to calculate the target infrared spectrum radiation brightness; The preset infrared spectrum radiation brightness function can be defined by the following expression: R total (λ)=M(λ)*T L (λ)+R Lpath (λ)+R bg (l) Where M(λ) represents the target radiation brightness at wavelength λ, T L (λ) represents the atmospheric spectral transmittance at wavelength λ, R Lpath (λ) represents the path radiation value at wavelength λ, R bg (λ) represents the sky background radiation texture value at wavelength λ, L represents the distance between the target thermal model and the infrared detector, (x1, y1, z1) represents the spatial coordinates corresponding to the target thermal model, and (x2, y2, z2) represents the spatial coordinates corresponding to the infrared detector.
6. The method according to claim 5, characterized in that The first spectral data also includes: the world coordinates of the target thermal model; the generating and displaying of the infrared spectral image of the target thermal model based on the plurality of target infrared spectral radiation brightness and the plurality of spectral data includes: According to the world coordinates, determining, by a vertex shader, a target position of each pixel point of the infrared spectrum image displayed on a display device; According to the infrared spectrum radiation brightness of the target, the pixel radiance value of each pixel point corresponding to the target position is determined by a fragment shader; An infrared spectrum image of the target thermal model is displayed according to the target position and the pixel radiance value.
7. The method according to claim 1, characterized in that The method further comprises: According to the target infrared spectral radiation brightness corresponding to multiple continuous wavelengths, the infrared spectral radiation brightness corresponding to the preset band is obtained.
8. The method according to claim 1, characterized in that The method further comprises: According to the RGBA channels corresponding to the target thermal model, a plurality of storage channels are determined.
9. An infrared spectrum image generation device based on parallel computing, characterized in that: include: A spectral data acquisition module is used to acquire spectral data corresponding to a target thermal model at a plurality of continuous wavelengths, and cache the plurality of spectral data to a plurality of storage channels, wherein each storage channel stores spectral data at a plurality of different wavelengths; A calculation module, used for parallel calculation of a plurality of spectral data of different wavelengths stored in each storage channel to obtain a plurality of target infrared spectral radiation brightness; A generation and display module is used to generate and display an infrared spectrum image of the target thermal model based on the multiple target infrared spectrum radiation brightness and the multiple spectrum data.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the infrared spectrum image generation method based on parallel computing described in any one of claims 1 to 8 are implemented.