Spectral image real-time splicing method based on cache and position correction
By using caching and position correction methods, the azimuth and elevation angles of the spectral image are reset, and the column number and column offset are determined. This solves the problems of jitter and uneven rotation speed in spectral image stitching, and achieves high-frequency real-time stitching effect.
Patent Information
- Application Number
- CN202511385079.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2025-12-23
AI Technical Summary
In existing technologies, the jitter and rotational jitter of hyperspectral cameras, as well as the uneven azimuth and rotational speed, cause the loss of spectral information in the stitched images, affecting the real-time performance and completeness of the stitching results.
By using caching and position correction methods, the azimuth and elevation angles of the spectral image are reset, the column number and column offset are determined, and the spectral image is accurately positioned and stitched in the real-time monitoring image, reducing the impact of jitter and uneven rotation speed, and high-frequency stitching is achieved by caching image information.
It effectively reduces the impact of jitter and uneven rotation speed during the spectral image stitching process, realizes high-frequency real-time stitching, and improves the real-time performance and integrity of spectral image stitching.
Smart Images

Figure CN121190301A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and in particular relates to a real-time spectral image stitching method based on caching and position correction. Background Technology
[0002] Hyperspectral cameras can acquire images of multiple spectral bands within the same area in real time and are widely used in satellite remote sensing, ground monitoring, and other fields. While the multi-spectral imaging capabilities of hyperspectral cameras are well-suited for tasks such as target identification, their relatively small field of view prevents them from obtaining complete images of the monitored target. To acquire complete real-time monitoring images using a hyperspectral camera, the authors' mission employed a turntable to mount the camera. The turntable's rotation caused the camera to rotate at a constant speed, and the spectral images of a specific spectral band during rotation were extracted and stitched together to obtain the real-time monitoring image. To achieve a larger field of view and better monitoring results, the mission raised the turntable to 15 meters above the ground, achieving a maximum azimuth rotation speed of 5.4 degrees / s, corresponding to a maximum frame rate of 168 Hz for the hyperspectral camera. While real-time stitching of spectral images can acquire multi-spectral band monitoring images in real time, allowing for target acquisition and tracking even when the target is "hidden" in one or more spectral bands, vibrations of the turntable housing the hyperspectral camera and uneven azimuth rotation can cause the stitched real-time monitoring images to lack spectral information, significantly affecting the displayed results. Furthermore, the high frame rate of the hyperspectral camera and the complexity of the stitching algorithm also greatly impact the real-time performance of the spectral image stitching algorithm. Summary of the Invention
[0003] In view of this, the present invention aims to provide a real-time spectral image stitching method based on caching and position correction. By resetting the azimuth and elevation angles of the spectral image to be stitched, the column number of the spectral image to be stitched in the real-time monitoring image is obtained and the spectral image to be stitched is aligned, thereby reducing the impact of uneven rotation speed and jitter caused by rotation during the shooting process on the stitching result. In addition, the present invention caches the image information, azimuth information, and elevation angle information of the spectral image to be stitched, so as to achieve high-frequency real-time stitching.
[0004] To achieve the above objectives, the technical solution created by this invention is implemented as follows: A real-time spectral image stitching method based on caching and position correction includes: S1: Control the spectral camera to capture the target and obtain the first frame of spectral image, as well as its azimuth and elevation angles; S2: Change the shooting angle and control the spectral camera to take another picture of the target to obtain the current frame spectral image to be stitched, and cache the current frame spectral image and its azimuth and elevation angles; S3: Based on the azimuth and elevation angles of the previous frame of the spectral image, reset the azimuth and elevation angles of the next frame of the spectral image, and determine the column number and column offset in the real-time monitoring image formed after stitching based on the reset azimuth and elevation angles. S4: Based on the column number obtained in step S3, determine the size of the real-time monitoring image and create an empty real-time monitoring image of the corresponding size; stitch the spectral image obtained in step S2 into the empty real-time monitoring image according to the column number and column offset obtained in step S3. S5: Repeat steps S2 to S5 to complete the real-time stitching of the real-time monitoring images.
[0005] Furthermore, step S1 also includes: determining the number of spectral images to be stitched in one display cycle based on the frequency of the spectral camera and the real-time display frequency of the images, numbering the spectral images to be stitched in one display cycle, and assigning corresponding spectral image flag bits.
[0006] Furthermore, in step S2, a stitching data buffer is constructed, which includes a flag cache, an azimuth cache, an elevation cache, a stitched image cache, and a display stitching flag. Specifically: the flag cache is used to cache the spectral image flag of each stitched spectral image; the azimuth cache is used to cache the azimuth of each stitched spectral image; the elevation cache is used to cache the elevation of each stitched spectral image; the stitched image cache is used to cache each stitched spectral image; and the display stitching flag is used to determine whether all spectral images in a display period need to be stitched.
[0007] Furthermore, in step S3, the azimuth angle of the next frame of the spectral image is reset based on the azimuth angle of the previous frame, and the column number of the spectral image in the real-time monitoring image formed after stitching is determined based on the reset azimuth angle: Reset the azimuth angle using the following formula: AH(i) = AH0(i) + 360 × Times; Where AH0(i) represents the initial azimuth angle of the i-th spectral image in the image buffer to be stitched, AH(i) represents the reset azimuth angle of the i-th spectral image, and Time represents the multiple of 360° to be superimposed, which is obtained by the following formula: Times=Times Last +1 when A Last -AH(i)>359; Among them, Times Last A represents a multiple of 360° superimposed on the previous spectral image. LastIndicates the initial azimuth angle of the previous spectral image; The column number of the spectral image in the real-time monitoring image is determined by the following formula: ; Where A0 represents the reference azimuth angle, A step This represents the difference in azimuth angle between two adjacent spectral images in a real-time monitoring image, where M represents the column number of the spectral image.
[0008] Furthermore, in step S3, the pitch angle of the next frame of the spectral image is reset based on the pitch angle of the previous frame, and the column offset in the real-time monitoring image formed after stitching is determined based on the reset pitch angle: Reset the pitch angle using the following formula: EH(i) = EH0(i) + 360, when E last -EH(i)>359; Where EH0(i) represents the initial azimuth angle of the i-th spectral image in the image buffer to be stitched, and EH(i) represents the reset elevation angle of the i-th spectral image. last Indicates the initial elevation angle of the previous spectral image; The column offset of the i-th spectral image in the real-time monitoring image is calculated using the following formula: ; Where needcut represents column offset, E0 represents reference pitch angle, and E step It represents the difference in elevation angle between two adjacent spectral images in a real-time monitoring image.
[0009] Further, step S4 includes: determining the width of the real-time monitoring image based on the maximum value of the column number; determining the size of the real-time monitoring image based on the width of the real-time monitoring image and creating an empty real-time monitoring image of the corresponding size; determining the splicing range of the spectral image based on the column number, the maximum value of the column number, and the width of the real-time monitoring image, and determining the column number of the current frame spectral image within the splicing range; and splicing the current frame spectral image in the empty real-time monitoring image according to the column number and column offset within the splicing range, based on the display splicing flag and the spectral image flag of the spectral image to be spliced.
[0010] Furthermore, the splicing range is as follows: M max -W0+1≤M≤M max ; Among them, M max W0 represents the maximum value of the column number, W0 represents the maximum width of the real-time monitoring image, and M represents the column number of the spectral image. The column number of the current frame's spectral image within the stitching range is determined by the following formula: M x =M-(M max -W0+1); Among them, M x This indicates the column number of the current frame's spectral image within the stitching range.
[0011] Furthermore, during the process of stitching the current frame spectral image into an empty real-time monitoring image according to the column number and column offset within the stitching range: if the stitching width at the current moment is less than the maximum width, the current frame spectral image is directly stitched with the previous frame real-time monitoring image column by column; if the stitching width at the current moment is greater than or equal to the maximum width, the image outside the maximum width in the previous frame real-time monitoring image is removed, and then the current frame spectral image is stitched with the processed real-time monitoring image column by column; during the process of stitching the current frame spectral image into an empty real-time monitoring image according to the column offset within the stitching range: if the column offset is greater than 0, the lower-aligned portion of the spectral image is copied to the next column of the previous frame real-time monitoring image; if the column offset is equal to 0, the spectral image is directly moved to the next column of the previous frame real-time monitoring image; if the column offset is greater than 0, the upper-aligned portion of the spectral image is copied to the next column of the previous frame real-time monitoring image.
[0012] Furthermore, during the process of displaying the splicing flag and the spectral image flag of the spectral image to be spliced: an OR operation is performed between the displaying the splicing flag and the spectral image flag of the spectral image to be spliced; if the result is 0, the spectral images of one display cycle are spliced according to the numbering order of the spectral images; if the result is 1, the corresponding splicing is completed according to the order of the spectral images to be spliced in the image buffer area to be spliced.
[0013] Furthermore, step S5 also includes: after the real-time stitching of the real-time monitoring images is completed, clearing the stitching data buffer area.
[0014] Compared with the prior art, the present invention can achieve the following beneficial effects: This invention presents a real-time spectral image stitching method based on caching and position correction. Firstly, to reduce the impact of rotational jitter and uneven azimuth rotation on the stitching result during shooting, this invention calculates the column number of the spectral image to be stitched within the real-time monitoring image using the azimuth angle, suppressing the effects of lateral rotational jitter and uneven azimuth rotation. Furthermore, it aligns the spectral image to be stitched with the real-time monitoring image using the elevation angle to suppress the effects of longitudinal rotational jitter. Secondly, to achieve high-frequency real-time stitching, this invention caches the image information, azimuth angle information, and elevation angle information of the spectral image to be stitched, stitching all cached spectral images every n frames and clearing the cache area. Finally, this invention reduces the computational load of the stitching algorithm by cropping the displayed image size, better meeting real-time requirements. Attached Figure Description
[0015] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments and descriptions of the invention are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 A schematic flowchart of the real-time spectral image stitching method based on caching and position correction described in the embodiments of the present invention; Figure 2 A flowchart illustrating the real-time spectral image stitching method based on caching and position correction as described in the embodiments of the present invention; Figure 3 A schematic diagram illustrating the spectral image stitching process described in the embodiments of the present invention; Figure 4 A schematic diagram of the data cache described in the embodiments of the present invention; Figure 5 A schematic diagram illustrating image stitching according to column numbers as described in an embodiment of the present invention; Figure 6 A schematic diagram illustrating image stitching according to column offset as described in an embodiment of the present invention; Figure 7 This is a real-time image of the visible spectrum and shortwave spectrum stitched together at the maximum frame rate, as described in the embodiments of the present invention. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not constitute a limitation thereof.
[0017] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0018] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this invention. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0019] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0020] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] like Figure 1 and Figure 2 As shown in the embodiments of the present invention, the real-time spectral image stitching method based on caching and position correction includes: S1: Control the spectral camera to capture the target and obtain the first frame of spectral image, along with its azimuth and elevation angles.
[0022] In some embodiments, step S1 further includes: determining the number of spectral images to be stitched in one display cycle based on the frequency of the spectral camera and the real-time display frequency of the images, numbering the spectral images to be stitched in one display cycle, and assigning corresponding spectral image flag bits.
[0023] In this embodiment of the invention, step S1 specifically includes: S11: Control the spectral camera to capture the target and obtain the first frame of spectral image, as well as its azimuth angle A0 and elevation angle E0; S12: The azimuth angle A0 and elevation angle E0 of the first frame spectral image are used as the stitching reference for the stitched image. At this time, the height H of the real-time monitoring image P formed after stitching is the height H0 of the first frame spectral image. The width W of the real-time monitoring image P is set to 1, and the maximum column number M of the spectral image in the real-time monitoring image formed after stitching is... max =1, copy the k-th column image I(1)(k) of the first frame spectral image to the first column P(0) of the real-time monitoring image P; S13: Based on the frequency of the spectral camera and the real-time display frequency of the images, the number of spectral images required for one display cycle is determined by the following formula: n = Fc / Fs; Where Fs represents the real-time display frequency of the real-time monitoring image P, Fc represents the frequency of the spectroscopic camera, n represents the number of spectroscopic images to be stitched in one display cycle, and / represents integer division. If the frequency of the spectroscopic camera is less than the real-time display frequency, then n is set to 1. In addition, in order to stitch the spectroscopic images more accurately in sequence, all spectroscopic images in one display cycle need to be numbered x (0≤x≤n) sequentially.
[0024] S2: Change the shooting angle and control the spectrophotometer to take another picture of the target to obtain the current frame spectrophotometer image to be stitched, and cache the current frame spectrophotometer image and its azimuth and elevation angles. In this embodiment of the invention, the spectrophotometer camera is placed on a turntable, and the turntable drives the spectrophotometer camera to rotate at a constant speed. During the subsequent image stitching process, the k-th column of each frame spectrophotometer image is extracted in real time and stitched together to form a new real-time monitoring image P, as follows. Figure 3 As shown.
[0025] In some embodiments, in step S2, a stitching data buffer is constructed. The stitching data buffer includes a flag bit buffer, an azimuth angle buffer, an elevation angle buffer, a to-be-stitched image buffer, and a display stitching flag bit. Specifically, the flag bit buffer is used to cache the spectral image flag bit of each to-be-stitched spectral image; the azimuth angle buffer is used to cache the azimuth angle of each to-be-stitched spectral image; the elevation angle buffer is used to cache the elevation angle of each to-be-stitched spectral image; the to-be-stitched image buffer is used to cache each to-be-stitched spectral image; and the display stitching flag bit is used to determine whether all spectral images in a display cycle need to be stitched.
[0026] In this embodiment of the invention, the constructed stitching data buffer area includes a flag bit buffer SH[n], an azimuth angle buffer AH[n], an elevation angle buffer EH[n], an image buffer area IH[n] to be stitched, and a display stitching flag bit S.
[0027] The flag bit buffer SH[n] is used to buffer the spectral image flag bit S(x) of each spectral image to be stitched, the azimuth angle buffer AH[n] is used to buffer the azimuth angle A(x) of each spectral image to be stitched, the elevation angle buffer EH[n] is used to buffer the elevation angle E(x) of each spectral image to be stitched, and the image to be stitched buffer is used to buffer each spectral image to be stitched (in this embodiment, it is the k-th column image I(x)(k) of each spectral image to be stitched). When the spectral image with number x needs to be stitched, the flag bit S(x), azimuth angle A(x), elevation angle E(x), and the k-th column image I(x)(k) of the spectral image to be stitched need to be arranged as follows: Figure 4 The data is placed into the splicing data buffer as shown.
[0028] S3: Based on the azimuth and elevation angles of the previous frame of the spectral image, reset the azimuth and elevation angles of the next frame of the spectral image, and determine the column number and column offset in the real-time monitoring image formed after stitching based on the reset azimuth and elevation angles.
[0029] In some embodiments, the azimuth angle ranges from [0, 360]. To meet the requirements of infinite spectral image stitching, a multiple of 360° for stacking is set, and the azimuth angle is reset using the following formula: AH(i) = AH0(i) + 360 × Times; Where AH0(i) represents the initial azimuth angle of the i-th spectral image in the image buffer to be stitched, 0≤i≤n, AH(i) represents the reset azimuth angle of the i-th spectral image, and Time represents the multiple of 360° to be superimposed. The multiple of 360° to be superimposed is initialized to 0. The multiple Time is obtained by the following formula: Times=Times Last +1 when A Last -AH(i)>359; Among them, Times Last A represents a multiple of 360° superimposed on the previous spectral image. Last Indicates the initial azimuth angle of the previous spectral image; The column number of the spectral image in the real-time monitoring image is determined by the following formula: ; Where A0 represents the reference azimuth angle, A step This represents the difference in azimuth angle between two adjacent spectral images in a real-time monitoring image, where M represents the column number of the spectral image.
[0030] In this invention, to avoid situations where AH(i)-A0 is slightly less than m×A during integer division operations... stepThis results in a column number that should be m being m-1. This embodiment of the invention sets a 10% tolerance and calculates the column number M at this time using the following formula: M=M+1, when AH(i)-A0-M×A step >0.9×A step .
[0031] In some embodiments, the pitch angle is reset using the following formula: EH(i) = EH0(i) + 360, when E last -EH(i)>359; Where EH0(i) represents the initial azimuth angle of the i-th spectral image, EH(i) represents the reset elevation angle of the i-th spectral image, and E last Indicates the initial elevation angle of the previous spectral image; The column offset of the i-th spectral image in the real-time monitoring image is calculated using the following formula: ; Where needcut represents column offset, E0 represents reference pitch angle, and E step This represents the difference in elevation angle between two adjacent spectral images in a real-time monitoring image. In this embodiment of the invention, the column offset of the i-th spectral image in the real-time monitoring image specifically refers to the column offset of the i-th spectral image relative to the first frame spectral image in the real-time monitoring image. Similarly, to avoid the integer division operation where EH(i)-E0 is slightly less than m×E step This resulted in an offset of m-1 columns instead of the intended m-column offset. This embodiment of the invention sets a 10% tolerance and calculates the required offset using the following formula: needcut=needcut+1, when AH(i)-A0-M x ×E step >0.9×E step .
[0032] S4: Based on the column number obtained in step S3, determine the size of the real-time monitoring image and create an empty real-time monitoring image of the corresponding size; stitch the spectral image obtained in step S2 into the empty real-time monitoring image according to the column number and column offset obtained in step S3.
[0033] In some embodiments, step S4 includes: S41: Determine the width of the real-time monitored image based on the maximum value of the column number. In this embodiment of the invention, the maximum value of the column number is updated in real time using the following formula: M max =M, when M>M max ; The width of the real-time monitoring image is determined by the following formula based on the maximum value of the column number: ; Among them, M max W represents the maximum value of the column number, W represents the width of the real-time monitoring image, and W0 represents the maximum width of the real-time monitoring image. S42: Determine the size of the real-time monitoring image based on its width and create an empty real-time monitoring image of the corresponding size; S43: Based on the column number, the maximum value of the column number, and the width of the real-time monitored image, determine the stitching range of the spectral image, and determine the column number of the current frame spectral image within the stitching range; wherein, the stitching range is obtained by the following formula: M max -W0+1≤M≤M max ; The column number of the current frame's spectral image within the stitching range is determined by the following formula: M x =M-(M max -W0+1).
[0034] Among them, M x This indicates the column number of the current frame's spectral image within the stitching range; S44: The current frame spectral image is stitched together in real-time using the empty monitoring image according to the column number and column offset within the stitching range, based on the displayed stitching flag and the spectral image flag of the image to be stitched. In some embodiments, the image stitching process in step S44 is as follows: Figure 5 and Figure 6 As shown.
[0035] like Figure 5 As shown, during the process of stitching the current frame spectral image into the empty real-time monitoring image according to the column number in the stitching range: If the current splicing width is less than the maximum width, such as Figure 5 As shown in (a), the current frame's spectral image is directly arranged column by column. Figure 5 (a) The white area) and the real-time monitoring image of the previous frame ( Figure 5 (a) The red area is spliced together; if the splicing width at the current moment is greater than or equal to the maximum width, such as Figure 5 As shown in (b), the image outside the maximum width in the real-time monitoring image of the previous frame is removed. Figure 5 (b) yellow area), then the current frame spectral image ( Figure 5 (b) white area) and the processed real-time monitoring image ( Figure 5(b) The red area is stitched together. The method of cropping the display image size reduces the computational load of the stitching algorithm and better meets real-time requirements.
[0036] like Figure 6 As shown, during the process of stitching the current frame spectral image with the empty real-time monitoring image according to the column offset in the stitching range: If the column offset is greater than 0, such as Figure 6 As shown in (a), the lower-aligned portion of the spectral image ( Figure 6 (a) The red area is copied to the next column of the real-time monitoring image of the previous frame; If the column offset is equal to 0, such as Figure 6 As shown in (b), the spectral image is directly fed into the next column of the real-time monitoring image of the previous frame; If the column offset is greater than 0, such as Figure 6 As shown in (c), the aligned portions on the spectral image ( Figure 6 (c) The red area is copied to the next column of the real-time monitoring image of the previous frame.
[0037] In some embodiments, during the process of displaying the splicing flag and the spectral image flag of the spectral image to be spliced: an OR operation is performed between the displaying the splicing flag and the spectral image flag of the spectral image to be spliced; if the result is 0, a spectral image of one display period is spliced according to the numbering order of the spectral images; if the result is 1, the corresponding splicing is completed according to the order of the spectral images to be spliced in the image buffer area to be spliced.
[0038] S5: Repeat steps S2 to S5 to complete the real-time stitching of the real-time monitoring images.
[0039] In some embodiments, step S5 further includes: after the real-time stitching of the real-time monitoring images is completed, clearing the stitching data cache area.
[0040] To demonstrate the good image stitching effect of the real-time spectral image stitching method based on caching and position correction provided by this invention, embodiments of this invention provide stitching effects of visible and shortwave spectra under three different azimuth and elevation angles, such as... Figure 7 As shown. Figure 7 Image (a) shows the stitched image of the visible spectrum (left) and shortwave spectrum (right) at an azimuth angle of 222°1′20″ and an elevation angle of 357°38′55″. Figure 7 (b) shows the stitched image of the visible spectrum (left) and shortwave spectrum (right) at an azimuth angle of 226°18′30″ and an elevation angle of 357°38′54″. Figure 7Image (c) shows the stitching effect of the visible spectrum (left) and shortwave spectrum (right) from the stitched visible spectrum image (167Hz) and the stitched shortwave spectrum image (143Hz). Figure 7 The correctly stitched and complete image shows that the real-time spectral stitching operation of this invention can effectively expand the field of view in the real-time monitoring field of spectral cameras.
[0041] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this invention disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this invention does not impose any limitations herein.
[0042] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A real-time spectral image stitching method based on caching and position correction, characterized in that, include: S1: Control the spectral camera to capture the target and obtain the first frame of spectral image, as well as its azimuth and elevation angles; S2: Change the shooting angle and control the spectral camera to take another picture of the target to obtain the current frame spectral image to be stitched, and cache the current frame spectral image and its azimuth and elevation angles; S3: Based on the azimuth and elevation angles of the previous frame of the spectral image, reset the azimuth and elevation angles of the next frame of the spectral image, and determine the column number and column offset in the real-time monitoring image formed after stitching based on the reset azimuth and elevation angles. S4: Based on the column number obtained in step S3, determine the size of the real-time monitoring image and create an empty real-time monitoring image of the corresponding size; stitch the spectral image obtained in step S2 into the empty real-time monitoring image according to the column number and column offset obtained in step S3. S5: Repeat steps S2 to S5 to complete the real-time stitching of the real-time monitoring images.
2. The real-time spectral image stitching method based on caching and position correction according to claim 1, characterized in that, Step S1 also includes: Based on the frequency of the spectral camera and the real-time display frequency of the images, the number of spectral images that need to be stitched together in one display cycle is determined, and the spectral images that need to be stitched together in one display cycle are numbered and assigned corresponding spectral image flag bits.
3. The real-time spectral image stitching method based on caching and position correction according to claim 2, characterized in that, In step S2, a stitching data buffer is constructed, which includes a flag buffer, an azimuth buffer, an elevation buffer, a buffer of images to be stitched, and display stitching flags, wherein: The flag buffer is used to cache the spectral image flags of each spectral image to be stitched together; The azimuth buffer is used to cache the azimuth of each spectral image to be stitched together; The pitch angle buffer is used to cache the pitch angle of each spectral image to be stitched together; The image buffer is used to cache each spectral image to be stitched. The display stitching flag is used to determine whether all spectral images in a display period need to be stitched together.
4. The real-time spectral image stitching method based on caching and position correction according to claim 3, characterized in that, In step S3, the azimuth angle of the next frame of the spectral image is reset based on the azimuth angle of the previous frame, and the column number of the spectral image in the real-time monitoring image formed after stitching is determined based on the reset azimuth angle: Reset the azimuth angle using the following formula: AH(i) = AH0(i) + 360 × Times; Where AH0(i) represents the initial azimuth angle of the i-th spectral image in the image buffer to be stitched, AH(i) represents the reset azimuth angle of the i-th spectral image, and Time represents the multiple of 360° to be superimposed, which is obtained by the following formula: Times=Times Last +1, when A Last -AH(i)>359; Among them, Times Last A represents a multiple of 360° superimposed on the previous spectral image. Last Indicates the initial azimuth angle of the previous spectral image; The column number of the spectral image in the real-time monitoring image is determined by the following formula: ; Where A0 represents the reference azimuth angle, A step This represents the difference in azimuth angle between two adjacent spectral images in a real-time monitoring image, where M represents the column number of the spectral image.
5. The real-time spectral image stitching method based on caching and position correction according to claim 3, characterized in that, In step S3, the elevation angle of the next frame of the spectral image is reset based on the elevation angle of the previous frame, and the column offset in the real-time monitoring image formed after stitching is determined based on the reset elevation angle. Reset the pitch angle using the following formula: EH(i) = EH0(i) + 360 when E last -EH(i) > 359; Where EH0(i) represents the initial azimuth angle of the i-th spectral image in the image buffer to be stitched, and EH(i) represents the reset elevation angle of the i-th spectral image. last Indicates the initial elevation angle of the previous spectral image; The column offset of the i-th spectral image in the real-time monitoring image is calculated using the following formula: ; Where needcut represents column offset, E0 represents reference pitch angle, and E step It represents the difference in elevation angle between two adjacent spectral images in a real-time monitoring image.
6. The real-time spectral image stitching method based on caching and position correction according to claim 3, characterized in that, Step S4 includes: The width of the real-time monitoring image is determined based on the maximum value of the column number; Based on the width of the real-time monitoring image, determine the size of the real-time monitoring image and create an empty real-time monitoring image of the corresponding size; Based on the column number, the maximum value of the column number, and the width of the real-time monitored image, the stitching range of the spectral image is determined, and the column number of the current frame spectral image within the stitching range is determined. The current frame spectral image is stitched together in real time in the empty monitoring image according to the column number and column offset in the stitching range, based on the displayed stitching flag and the spectral image flag of the image to be stitched.
7. The real-time spectral image stitching method based on caching and position correction according to claim 6, characterized in that, The splicing range is: M max -W0+1≤M≤M max ; Among them, M max W0 represents the maximum value of the column number, W0 represents the maximum width of the real-time monitoring image, and M represents the column number of the spectral image. The column number of the current frame's spectral image within the stitching range is determined by the following formula: M x =M-(M max -W0+1); Among them, M x This indicates the column number of the current frame's spectral image within the stitching range.
8. The real-time spectral image stitching method based on caching and position correction according to claim 7, characterized in that, During the process of stitching the current frame spectral image together with the empty real-time monitoring image according to the column number in the stitching range: If the current stitching width is less than the maximum width, the current frame spectral image is directly stitched with the previous frame real-time monitoring image column by column; if the current stitching width is greater than or equal to the maximum width, the images in the previous frame real-time monitoring image that are not of the maximum width are removed, and then the current frame spectral image is stitched with the processed real-time monitoring image column by column. During the process of stitching the current frame spectral image with the empty real-time monitoring image according to the column offset in the stitching range: If the column offset is greater than 0, copy the lower-aligned portion of the spectral image to the next column of the real-time monitoring image of the previous frame; If the column offset is 0, the spectral image will be moved directly to the next column of the previous frame's real-time monitoring image; If the column offset is greater than 0, copy the aligned portion of the spectral image to the next column of the real-time monitoring image of the previous frame.
9. The real-time spectral image stitching method based on caching and position correction according to claim 8, characterized in that, Based on the process of displaying the splicing flag and the spectral image flag of the spectral image to be spliced: The display stitching flag will be ORed with the spectral image flag of the image to be stitched: If the result is 0, a display period of spectral images is stitched together according to the numbering order of the spectral images; If the result is 1, the corresponding stitching is completed according to the order of the spectral images to be stitched in the image buffer area.
10. The real-time spectral image stitching method based on caching and position correction according to claim 3, characterized in that, Step S5 also includes: Once the real-time image stitching is complete, clear the stitching data cache.