Image splicing method, image splicing device, terminal and computer storage medium

By acquiring and converting the actual displacement of the image to be stitched, the overlapping area of ​​the image is acquired and locally fused, the problems of complex calculations and inaccurate matching during high-gray-level image stitching are solved, and efficient and accurate image stitching effect is achieved.

CN119624764APending Publication Date: 2025-03-14IRAY TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411614616.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When performing high-gray-level image stitching, the gray-scale changes between images are relatively subtle and feature points are difficult to distinguish, resulting in complex calculations and insufficient matching results, and the stitching effect of the image is not ideal.

Method used

By obtaining the actual displacement amount of the image to be stitched, it converts it into the stitching displacement amount, and obtaining the overlapping area of ​​the image based on the stitching displacement amount, and performing local fusion to achieve image stitching.

Benefits of technology

The calculation complexity during the image stitching process is simplified, the efficiency of image stitching is improved, the accuracy of overlapping areas is enhanced, the image quality is improved, and the better stitching effect is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624764A_ABST
    Figure CN119624764A_ABST
Patent Text Reader

Abstract

The invention provides an image splicing method, an image splicing device, a terminal and a computer storage medium, and the method comprises the steps: obtaining all to-be-spliced images, obtaining the actual displacement between two adjacent to-be-spliced images based on a spatial position relation, and obtaining the actual displacement between the two adjacent to-be-spliced images; according to the method, the two to-be-spliced images are subjected to actual displacement, the overlapping area corresponding to the two to-be-spliced images is obtained based on the actual displacement, and the to-be-spliced images are spliced and fused based on the overlapping area to obtain the final spliced image, so that the calculation complexity in the image splicing process is simplified, and the image quality of the spliced image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing and relates to an image stitching technology, and in particular to an image stitching method, an image stitching device, a terminal and a computer storage medium. Background Art

[0002] In the production and manufacturing process of workpieces, visual industrial inspection is an important means of inspecting the quality of workpieces. For large workpieces, it is often necessary to take multiple photos and stitch the images together to obtain a complete workpiece image for analysis.

[0003] In the prior art, the image stitching method is generally to find the feature points of the images to be stitched and perform feature matching to achieve image stitching. However, for images with high grayscale, such as images taken by X-ray detectors, the grayscale changes between images are relatively subtle, and the feature points are difficult to distinguish from the background, which leads to complex calculations and inaccurate matching, and the image stitching effect is not ideal.

[0004] Therefore, how to achieve accurate stitching of high grayscale images and reduce the difficulty of calculation is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0005] The purpose of the present application is to provide an image stitching method, an image stitching device, a terminal and a computer storage medium, which are used to solve the problem in the prior art that when performing feature point matching on high grayscale images to achieve image stitching, the feature points are difficult to distinguish due to the subtle changes in the grayscale between the images, resulting in complex calculations and inaccurate matching results, resulting in unsatisfactory image stitching effects.

[0006] In a first aspect, the present application provides an image stitching method, comprising:

[0007] Acquire a set of images to be stitched of a target object from an image detection system, acquire spatial position relationships and time relationships of all the images to be stitched in the set of images to be stitched based on relative motion trajectories, and sequentially sort the stitching positions of all the images to be stitched in the set of images to be stitched based on the corresponding spatial position relationships and time relationships to acquire a stitching position sequence of all the images to be stitched;

[0008] Based on the stitching position sequence, the actual displacement between two images to be stitched that are adjacent in spatial position is obtained through the spatial position of the images to be stitched, and all the actual displacements are converted into stitching displacements through a preset displacement conversion method;

[0009] Based on the stitching position sequence, obtaining an overlapping area corresponding to the two images to be stitched based on the stitching displacement of two images to be stitched that are adjacent in spatial position;

[0010] According to the stitching position sequence, two images to be stitched that are adjacent in spatial position are locally fused based on the corresponding overlapping areas in turn to obtain a final stitching image.

[0011] In the present application, the stitching displacement is obtained by the actual displacement between the two spatially adjacent images to be stitched, and then the overlapping area of ​​the two images to be stitched is corresponded, so as to perform image stitching, thereby avoiding a large amount of calculation of feature point matching, reducing the difficulty of image stitching, and the overlapping area obtained has a high accuracy, which is conducive to obtaining a stitched image of higher quality.

[0012] In one embodiment of the present application, the image detector is an X-ray detection system, and the image detection system includes a ray source for emitting X-rays and a detector for receiving X-rays;

[0013] The expression of the preset displacement conversion method is: S=SID / SOD*abs(diff), wherein S is the stitching displacement, SID is the distance from the ray source to the detector, SOD is the distance from the target object to the detector, diff is the actual displacement of the two adjacent images to be stitched in the spatial position, and abs(diff) is the absolute value of the actual displacement.

[0014] In one embodiment of the present application, the step of obtaining the overlapping area of ​​the two images to be stitched based on the stitching displacement of the two images to be stitched that are adjacent in spatial position includes:

[0015] The two images to be stitched that are adjacent in spatial position are respectively set to be a first image to be stitched and a second image to be stitched, and based on the stitching displacement and spatial position relationship between the first image to be stitched and the second image to be stitched, a first initial overlapping area of ​​the first image to be stitched and a second initial overlapping area of ​​the second image to be stitched are obtained;

[0016] Selecting a plurality of feature windows in the first initial overlapping area, selecting a comparison window corresponding to the position of each feature window in the second initial overlapping area, obtaining a comparison window group corresponding to each comparison window, finding the most similar window of each feature window from the corresponding comparison window group by a preset similarity determination method, relatively moving the first image to be stitched and the second image to be stitched so that each feature window in the first initial overlapping area corresponds to the corresponding most similar window position in the second initial overlapping area, and taking the latest overlapping area of ​​the first image to be stitched and the second image to be stitched after the relative movement as the overlapping area of ​​the first image to be stitched and the second image to be stitched;

[0017] The comparison window group corresponding to the comparison window includes the comparison window and other windows adjacent to the comparison window, and the sizes of all windows are the same.

[0018] In one embodiment of the present application, finding the most similar window to the feature window from the corresponding comparison window group by a preset similarity determination method includes: calculating the normalized correlation coefficient between each window in the comparison window group and the feature window respectively, and taking the window corresponding to the maximum value of the normalized correlation coefficient as the most similar window to the feature window.

[0019] In one embodiment of the present application, locally fusing two spatially adjacent images to be stitched based on the corresponding overlapping area includes:

[0020] Normalizing the two spatially adjacent images to be stitched respectively to serve as a first image to be fused and a second image to be fused, locally superimposing the first image to be fused and the second image to be fused based on the corresponding overlapping area to obtain a superimposed image, expanding the first image to be fused based on the superimposed image to obtain a first expanded image with the same size as the superimposed image, expanding the second image to be fused based on the superimposed image to obtain a second expanded image with the same size as the superimposed image, and constructing a weighted image with the same size as the superimposed image and a preset grayscale value;

[0021] The first extended image is decomposed to obtain a first image pyramid, the second extended image is decomposed to obtain a second image pyramid, the weighted image is decomposed to obtain a weighted image pyramid, the grayscale weight corresponding to each pixel in the weighted image pyramid is obtained based on the grayscale value of each pixel in the weighted image pyramid, the first image pyramid and the second image pyramid are weightedly fused based on the grayscale weight of each pixel in the weighted image pyramid to obtain a fused image pyramid, and the fused image pyramid is inversely decomposed to obtain a target image, which is an image obtained by locally fusion of two spatially adjacent images to be spliced.

[0022] In one embodiment of the present application, expanding the first image to be fused based on the overlay image to obtain a first expanded image having the same size as the overlay image, and expanding the second image to be fused based on the overlay image to obtain a second expanded image having the same size as the overlay image includes:

[0023] An area of ​​the first image to be fused except the corresponding overlapping area is obtained as a first extended area, and an area of ​​the second image to be fused except the corresponding overlapping area is obtained as a second extended area. Based on the spatial position relationship between the first image to be fused and the second image to be fused, the second extended area is spliced ​​with the first image to be fused to obtain a first extended image, and the first extended area is spliced ​​with the second image to be fused to obtain a first extended image.

[0024] In one embodiment of the present application, Laplacian image decomposition is performed on the first image to be stitched to obtain the first image to be stitched pyramid; Laplacian image decomposition is performed on the second image to be stitched to obtain the second image to be stitched pyramid; and Gaussian image decomposition is performed on the weight image to obtain the weight image pyramid.

[0025] In a second aspect, the present application provides an image stitching device, including a sorting module, an overlapping module and a fusion module;

[0026] The sorting module is used to obtain a set of images to be stitched of the target object from the image detection system, obtain the spatial position relationship and time relationship of all the images to be stitched in the set of images to be stitched based on the relative motion trajectory, and sequentially sort the stitching positions of all the images to be stitched in the set of images to be stitched based on the corresponding spatial position relationship and time relationship to obtain the stitching position sequence of all the images to be stitched;

[0027] The overlapping module is used to obtain the actual displacement of two spatially adjacent images to be stitched based on the stitching position sequence through the spatial positions of the images to be stitched, and to convert the actual displacement through a preset displacement conversion method to obtain the stitching displacement; based on the stitching position sequence, obtain the overlapping area of ​​two adjacent images to be stitched based on the stitching displacement of the two adjacent images to be stitched;

[0028] The fusion module is used to locally fuse two images to be stitched that are adjacent in spatial position based on the corresponding overlapping areas in sequence of stitching positions, so as to obtain a final stitched image.

[0029] In a third aspect, the present application provides a terminal, including: a processor and a memory, wherein the memory is communicatively connected to the processor;

[0030] The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes the image acquisition method as described above.

[0031] In a fourth aspect, the present application provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the image acquisition method as described above is implemented.

[0032] As described above, the present application provides an image stitching method, an image stitching device, a terminal and a computer storage medium, which obtains the corresponding overlapping area through the stitching displacement of two spatially adjacent images to be stitched, so as to stitch the images, effectively simplifying the calculation complexity in the image stitching process, thereby improving the efficiency of image stitching. At the same time, the present application improves the accuracy of the overlapping area while reducing the calculation difficulty through feature window comparison of the overlapping area, reduces the influence of the thickness of the target object on the image stitching effect, and improves the image quality of the stitched image by weighted fusion of the grayscale values ​​of the image, thereby achieving a better stitching effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 Shown is a schematic diagram of the structure of an X-ray detection system for acquiring images to be stitched in an embodiment of the present application.

[0034] Figure 2 Shown is a flow chart of an image stitching method described in an embodiment of the present application.

[0035] Figure 3 Shown is a schematic diagram of the movement of the target object corresponding to the two spatially adjacent images to be stitched as described in the embodiment of the present application.

[0036] Figure 4 Shown is a flow chart of a method for local fusion of two images to be stitched described in an embodiment of the present application.

[0037] Figure 5 Shown is a flow chart of a method for acquiring the overlapping area corresponding to the images to be stitched described in an embodiment of the present application.

[0038] Figure 6 Shown is a schematic diagram of the positional relationship between a comparison window group and a comparison window according to an embodiment of the present application.

[0039] Figure 7 Shown is a structural schematic diagram of an image stitching device described in an embodiment of the present application.

[0040] Figure 8 Shown is a schematic diagram of the structure of a terminal described in an embodiment of the present application.

[0041] Component number description

[0042] 10 X-ray detection system

[0043] 11. Radiation Source

[0044] 12 Detector

[0045] 13 Target Object

[0046] 21 Sorting module

[0047] 22 Overlapping Modules

[0048] 23 Fusion Module

[0049] 31 Processor

[0050] 32 Memory

[0051] 33 System bus DETAILED DESCRIPTION

[0052] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0053] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0054] Existing image stitching methods often use feature point detection algorithms to identify and locate feature points in the images to be stitched, and use matching algorithms to find matching feature points between the images to be stitched, and then fuse the images to obtain the stitched image. However, in the process of visual industrial inspection of workpieces, such as when using X-ray detectors to perform non-destructive inspection of workpieces, the high grayscale images obtained have subtle grayscale changes, and feature points are difficult to distinguish from the background, making it very difficult to identify and match feature points. As a result, this method is complex in calculation when used for image stitching for workpiece inspection, and the matching results are not accurate enough, which leads to unsatisfactory image stitching effects.

[0055] In view of the technical problems existing in the prior art, the following embodiments of the present application provide an image stitching method, an image stitching device, a terminal and a computer storage medium, by obtaining the actual displacement of the images to be stitched, and then obtaining the stitching displacement between the images to be stitched, so as to stitch the images to be stitched based on the stitching displacement, so as to realize image stitching. The method is simple, the calculation difficulty is small, and the stitching accuracy of high grayscale images is effectively improved, thereby achieving a good stitching effect.

[0056] The following embodiments of the present application provide an image stitching method, an image stitching device, a terminal and a computer storage medium, including but not limited to the stitching of large-size workpiece inspection images. The following description will take the imaging of large-size workpieces by X-ray detectors and non-destructive testing as an example.

[0057] like Figure 1 As shown, in order to obtain images to be stitched for a target object, this embodiment exemplarily provides an X-ray detection system 10, including: a ray source 11 for emitting X-rays; a detector 12 for receiving X-rays to form an image. Since the target object 13 photographed by the X-ray detector 10 is relatively large in size, multiple shots are required to obtain images of all areas of the target object 13 as a set of images to be stitched for the target object 13, and all the images to be stitched in the set of images to be stitched are high grayscale images. Based on this, this embodiment provides an image stitching method to stitch the photographed images and obtain a final stitched image to reflect the overall situation of the target object 13.

[0058] It should be noted that the image stitching method, image stitching device, terminal and computer storage medium provided in the following embodiments of the present application can also stitch images acquired by other methods, including but not limited to images acquired when inspecting large-size workpieces by Compton backscatter scanning imaging, secondary electron imaging, etc., and the present application does not make specific limitations here.

[0059] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application.

[0060] like Figure 2 As shown, this embodiment provides an image stitching method, including:

[0061] S100, obtaining a set of images to be stitched of a target object from an image detection system, obtaining spatial position relationships and time relationships of all the images to be stitched in the set of images to be stitched based on a relative motion trajectory, and sequentially sorting the stitching positions of all the images to be stitched in the set of images to be stitched based on the corresponding spatial position relationships and time relationships to obtain a stitching position sequence of all the images to be stitched.

[0062] The relative motion trajectory is a trajectory formed by the relative movement between the image detection system and the target object 13 when the image detection system acquires a set of images to be stitched for the target object 13. For example, Figure 1 As shown, the image detection system is an X-ray detection system 10. In the process of acquiring a set of images to be stitched for a target object 13, since the position of the ray source 11 generally remains unchanged, the relative motion trajectory is a trajectory formed by the relative movement between the detector 12 and the target object 13. It is assumed that all the images to be stitched in the set of images to be stitched are of the same size.

[0063] Specifically, a coordinate system is established, in which the ray source 11, the detector 12 and the target object 13 are all located. When acquiring each of the images to be stitched in the set of images to be stitched, that is, when taking images of various regions of the target object 13, relevant coordinates are recorded to form a relative motion trajectory, wherein the relevant coordinates are the coordinates of the target object 13, or the coordinates of the detector 12, or the coordinates of the target object 13 and the coordinates of the detector 12.

[0064] Exemplarily, when the position of the ray source 11 remains unchanged, a coordinate system is established with the position of the ray source 11 as the origin, and the coordinates of the detector 12 and the target object 13 are recorded at each shooting, and the set of these coordinates is used as the relative motion trajectory. It should be noted that in order to simplify the subsequent calculation process, the difference between the coordinates of the detector 12 and the coordinates of the target object 13 is recorded at each shooting, and the set of the difference is used as the relative motion trajectory.

[0065] Of course, when acquiring each of the images to be stitched in the set of images to be stitched, that is, when capturing images of various regions of the target object 13, the relative movement distance and direction of the detector 12 and the target object 13 during each two adjacent captures may be recorded to form the relative motion trajectory. As long as the relative movement between the detector 12 and the target object 13 when acquiring the set of images to be stitched can be characterized, this embodiment does not impose any specific limitation here.

[0066] Furthermore, when forming the relative motion trajectory, the images of various regions of the target object 13 are arranged based on the order in which they are photographed, so that the time relationship of all the images to be stitched can be obtained based on the relative motion trajectory. Thus, the spatial position relationship and time relationship of all the images to be stitched in the set of images to be stitched can be obtained based on the relative motion trajectory.

[0067] Further, all the images to be stitched in the set of images to be stitched are sorted in their stitching positions based on the corresponding spatial position relationship and time relationship, and the stitching position sequence of all the images to be stitched is obtained, including: obtaining the time sequence of the images to be stitched based on the time relationship of all the images to be stitched, and obtaining the stitching position sequence of two images to be stitched that are adjacent in time sequence based on the spatial position relationship between two images to be stitched that are adjacent in time sequence. Specifically, if the spatial position relationship of the two images to be stitched is a left-right relationship, the stitching position sequence of the two images to be stitched is a left-right position sequence; if the spatial position relationship of the two images to be stitched is a top-bottom relationship, the stitching position sequence of the two images to be stitched is a top-bottom position sequence.

[0068] Exemplarily, the coordinates of the detector 12 and the target object 13 corresponding to the two images to be stitched that are adjacent in time sequence are obtained, and the spatial position relationship of the two images to be stitched is obtained based on the change of the coordinates. Specifically, when the position of the ray source 11 remains unchanged, a coordinate system is established with the position of the ray source 11 as the origin, the vertical direction as the z-axis, the direction from the ray source 11 to the detector 12 as the y-axis, and the direction perpendicular to the z-axis and the y-axis as the x-axis. If the coordinates of the target object 13 corresponding to the two images to be stitched that are adjacent in time sequence are the same, compare the corresponding coordinates of the detector 12: when the values ​​of the detector 12 coordinates on the z-axis are the same, and the values ​​on the x-axis are different, the spatial position relationship of the two images to be stitched is a left-right relationship; when the values ​​of the detector 12 coordinates on the x-axis are the same, and the values ​​on the z-axis are different, the spatial position relationship of the two images to be stitched is a top-bottom relationship. If the coordinates of the target object 13 corresponding to the two images to be stitched that are adjacent in time sequence are the same, compare the corresponding detector 12 coordinates to obtain the spatial position relationship; if the detector 12 coordinates and the target object 13 coordinates corresponding to the two images to be stitched that are adjacent in time sequence are different, compare the difference between the corresponding detector 12 coordinates and the target object 13 coordinates to obtain the spatial position relationship. For the specific acquisition method, please refer to the aforementioned method of comparing the corresponding detector 12 coordinates to obtain the spatial position relationship, which will not be repeated here.

[0069] It should be noted that, in this embodiment, for ease of understanding, the relative motion trajectory is formed by the relative movement between the detector 12 and the target object 13 when acquiring each of the images to be stitched in the set of images to be stitched. However, in actual applications, the relative motion trajectory is generally preset based on actual needs, and the set of images to be stitched for the target object 13 is acquired by the relative movement corresponding to the detector 12 and the target object 13 according to the preset relative motion trajectory. However, it should be known that the corresponding relationship between the relative motion trajectory and each of the images to be stitched in the set of images to be stitched is consistent with the above content. For example, in actual applications, the coordinates or the moving distance and direction of the detector 12 and the target object 13 at each shooting are acquired through the preset relative motion trajectory.

[0070] S200, based on the stitching position sequence, obtaining actual displacement between two spatially adjacent images to be stitched according to the spatial positions of the images to be stitched, and converting all the actual displacements into stitching displacements according to a preset displacement conversion method.

[0071] The actual displacement is the actual relative displacement between the target object 13 and the detector 12 when acquiring two spatially adjacent images to be stitched. Exemplarily, the actual displacement between the target object 13 and the detector 12 is acquired by changing the coordinates of the detector 12 or the target object 13 when capturing the two images to be stitched, or the actual displacement between the target object 13 and the detector 12 is acquired by moving the distance and direction of the detector 12 and the target object 13 when capturing the two images to be stitched. Figure 3 As shown in FIG. 1 , taking the detector 12 as a reference, the position of the target object 13 corresponding to the two spatially adjacent images to be stitched relative to the detector 12 is obtained, wherein the solid line structure is the target object 13 in the previous time sequence, and the dotted line structure is the target object 13' in the later time sequence; the actual displacement is the distance that the target object 13 moves relative to the detector 12 when acquiring the two spatially adjacent images to be stitched, wherein the length of the overlapping area before and after the target object 13 moves, i.e. Figure 3 The area covered by the middle oblique line is the difference between the total length of the target object 13 and the actual displacement.

[0072] The stitching displacement is the distance of the relative movement between the target object 13 and the detector 12 in the image formed by the corresponding stitching image. Figure 1 As shown, since there is a certain distance between the ray source 11, the detector 12 and the target object 13, and the X-ray emitted by the ray source 11 is a divergent beam, the image to be stitched has a certain magnification ratio on the target object 13. Figure 1 As shown, the range formed by the two dotted lines is the range of the X-ray beam emitted by the ray source 11. Obviously, the range actually detected by the X-ray beam on the target object 13 is different from the range actually received by the detector 12, and there is a certain proportion of magnification. Based on this, the splicing displacement is also magnified by a certain proportion relative to the actual displacement, and the actual displacement needs to be converted into the splicing displacement by the preset displacement conversion method.

[0073] Specifically, based on the spatial geometric relationship among the ray source 11, the detector 12 and the target object 13, the magnification ratio of the image to be stitched to the target object 13 is obtained, and the magnification ratio is used as the preset displacement conversion method, or, through the image size of the target object 13 on the image to be stitched and the actual size of the target object 13, the size conversion relationship between the image to be stitched and the target object 13 is obtained, and the size conversion relationship is used as the preset displacement conversion method.

[0074] Exemplarily, the expression of the preset displacement conversion method is: S=SID / SOD*abs(diff), wherein S is the stitching displacement, SID is the distance from the ray source to the detector, SOD is the distance from the target object to the detector, the diff is the actual displacement of the two adjacent images to be stitched in the spatial position, and the abs(diff) is the absolute value of the actual displacement.

[0075] The stitching displacement between any two images to be stitched that are adjacent in spatial position in the stitching position sequence can be obtained in the above manner.

[0076] It should be noted that, since the images to be stitched are actually composed of pixels, in order to facilitate the movement of the images, the overlapping distance is expressed as the number of pixels. Specifically, the stitching displacement is expressed as the number of pixels. Specifically, the ratio of the stitching displacement to the width or height of the pixel is used as the number of stitching displacements, and the number of stitching displacements is used to represent the number of pixels offset between two spatially adjacent images to be stitched.

[0077] S300 , based on the stitching position sequence, and based on the stitching displacement of two spatially adjacent images to be stitched, obtaining an overlapping area corresponding to the two images to be stitched.

[0078] Specifically, based on the splicing displacement of two adjacent images to be spliced ​​in spatial position, combined with the spatial position relationship of the two images to be spliced, the overlapping distance of the two images to be spliced ​​is obtained, and based on the overlapping distance, the overlapping area of ​​the two images to be spliced ​​is obtained. Wherein, the overlapping distance is the length of the overlapping area. For ease of understanding, as Figure 3 In the figure, the overlapping distance is the length of the oblique line coverage area converted to the distance on the image to be stitched.

[0079] Exemplarily, if the spatial position relationship of the two images to be stitched is an up-and-down relationship, the overlapping distance is the difference between the height of the image to be stitched and the corresponding stitching displacement, and the overlapping areas of the two images to be stitched are obtained as follows: for the image to be stitched whose spatial position is located at the top, the overlapping area is located at the bottom of the image to be stitched, and the height is an area of ​​the overlapping distance, wherein the lower edge of the overlapping area is the lower edge of the image to be stitched; for the image to be stitched whose spatial position is located at the bottom, the overlapping area is located at the top of the image to be stitched, and the height is an area of ​​the overlapping distance, wherein the upper edge of the overlapping area is the upper edge of the image to be stitched.

[0080] If the spatial position relationship of the two images to be stitched is a left-right relationship, the overlapping distance is the difference between the width of the image to be stitched and the corresponding stitching displacement, and the overlapping areas of the two images to be stitched are obtained as follows: for the image to be stitched whose spatial position is located on the left, the overlapping area is located on the right side of the image to be stitched, and the width is an area of ​​the overlapping distance, wherein the right edge of the overlapping area is the right edge of the image to be stitched; for the image to be stitched whose spatial position is located on the right, the overlapping area is located on the left side of the image to be stitched, and the width is an area of ​​the overlapping distance, wherein the left edge of the overlapping area is the left edge of the image to be stitched.

[0081] Furthermore, if the stitching displacement is expressed in the form of the number of pixels, that is, the number of pixels offset between two spatially adjacent images to be stitched is the stitching displacement number. Based on this, based on the stitching displacement number and in combination with the spatial position relationship of the two images to be stitched, the number of overlaps of the two images to be stitched is obtained, and based on the overlapping number, the corresponding overlapping area is obtained. Specifically, the overlapping number is the difference between the total number of pixels in a row or a column of the image to be stitched and the number of stitching displacements, and the overlapping area is: starting from the edge of the image to be stitched, with the number of rows or columns corresponding to the overlapping number, the area containing the number of rows or columns is the overlapping area. Among them, if the spatial position relationship of the two images to be stitched is a left-right relationship, the number of overlaps is the difference between the total number of pixels in a row of the image to be stitched and the number of stitching displacements, and the overlapping area is an area with the corresponding number of overlaps as the number of columns; if the spatial position relationship of the two images to be stitched is an up-down relationship, the number of overlaps is the difference between the total number of pixels in a column of the image to be stitched and the number of stitching displacements, and the overlapping area is an area with the corresponding number of overlaps as the number of rows.

[0082] Since the images to be stitched are actually composed of pixels, obtaining the overlapping area based on the number of stitching displacements is beneficial to the subsequent steps of moving or stitching the stitched images.

[0083] In this embodiment, the overlapping area of ​​the two images to be stitched that are adjacent in spatial position is obtained, so as to subsequently stitch the two images to be stitched based on the overlapping area. Compared with the stitching by feature matching in the prior art, the method of this embodiment is simple, does not need to calculate the feature points, effectively reduces the difficulty of calculation, and has high accuracy in obtaining the overlapping area, which is conducive to improving the stitching effect of the subsequent stitching step.

[0084] By means of the above method, the overlapping area corresponding to any two images to be stitched that are adjacent in spatial position in the stitching position sequence can be obtained.

[0085] S400 , locally fusing two images to be stitched that are adjacent in spatial position based on the corresponding overlapping areas in sequence of stitching positions, so as to obtain a final stitched image.

[0086] The locally fusing the two spatially adjacent images to be spliced ​​refers to splicing and fusing the overlapping areas of the two spatially adjacent images to be spliced ​​so that the two images to be spliced ​​form one image.

[0087] Specifically, based on the stitching position sequence, starting from the first image to be stitched among all the images to be stitched, each time the adjacent subsequent image to be stitched is locally fused with the previous image to be stitched based on the corresponding overlapping area, until the last image to be stitched is locally fused with the penultimate image to be stitched based on the corresponding overlapping area, so as to achieve stitching and fusion of all the images to be stitched, and obtain a final stitched image.

[0088] For example, Figure 4 As shown, locally fusing two images to be stitched that are adjacent in spatial position based on the corresponding overlapping area includes:

[0089] S410, respectively normalizing the two spatially adjacent images to be stitched to serve as a first image to be fused and a second image to be fused, locally superimposing the first image to be fused and the second image to be fused based on the corresponding overlapping area to obtain a superimposed image, expanding the first image to be fused based on the superimposed image to obtain a first expanded image having the same size as the superimposed image, expanding the second image to be fused based on the superimposed image to obtain a second expanded image having the same size as the superimposed image, and constructing a weighted image having the same size as the superimposed image and a preset grayscale value.

[0090] Specifically, the grayscale value of each pixel of the weight image is a preset grayscale value. Exemplarily, the weight image includes two regions of equal size, wherein the grayscale value of each pixel in one region is 1, and the grayscale value of each pixel in the other region is 0; or, the grayscale value of each pixel of the weight image changes uniformly from 1 on one side and eventually becomes 0 on the other side, for example, from the left side to the right side, or from the top side to the bottom side; or, the grayscale value of each pixel of the weight image is preset based on other methods, and the present application does not impose any specific restrictions here.

[0091] It should be noted that, in order to facilitate the weighted fusion of images in the subsequent inverse decomposition step, the first image to be fused is expanded based on the superimposed image to obtain a first expanded image with the same size as the superimposed image, and the second image to be fused is expanded based on the superimposed image to obtain a second expanded image with the same size as the superimposed image, that is, the sizes of the first expanded image and the second expanded image are the same as the size of the superimposed image, so that each pixel point of the first expanded image and the second expanded image can correspond to each other, so as to facilitate the subsequent weighted fusion.

[0092] Specifically, the area of ​​the first image to be fused except the corresponding overlapping area is obtained as the first extended area, and the area of ​​the second image to be fused except the corresponding overlapping area is obtained as the second extended area. Based on the spatial positional relationship between the first image to be fused and the second image to be fused, the second extended area is spliced ​​with the first image to be fused to obtain the first extended image, and the first extended area is spliced ​​with the second image to be fused to obtain the first extended image. For example, if the first image to be fused is on the left side of the second image to be fused, the second extended area is spliced ​​to the right side of the first image to be fused, and the first extended area is spliced ​​to the left side of the second image to be fused; if the first image to be fused is on the upper side of the second image to be fused, the second extended area is spliced ​​to the lower side of the first image to be fused, and the first extended area is spliced ​​to the upper side of the second image to be fused.

[0093] S420: performing image decomposition on the first extended image to obtain a first image pyramid, performing image decomposition on the second extended image to obtain a second image pyramid, performing image decomposition on the weighted image to obtain a weighted image pyramid, obtaining a grayscale weight corresponding to each pixel point in the weighted image pyramid based on the grayscale value of each pixel point in the weighted image pyramid, performing weighted fusion on the first image pyramid and the second image pyramid based on the grayscale weight of each pixel point in the weighted image pyramid to obtain a fused image pyramid, and performing inverse decomposition processing on the fused image pyramid to obtain a target image, where the target image is an image obtained by locally fusion of two spatially adjacent images to be spliced.

[0094] Among them, image decomposition refers to losing or adding rows or columns of pixels of an image based on a specific method to obtain multiple images with different resolutions. These images with different resolutions are arranged layer by layer to form a multi-layered image pyramid. Specifically, those skilled in the art can perform image decomposition on the first image to be spliced, the second image to be spliced, and the weight image in different ways according to actual needs. For example, the first image to be spliced, the second image to be spliced, and the weight image are decomposed by any one of Laplace image decomposition and Gaussian image decomposition, wherein the first image to be spliced ​​and the second image to be spliced ​​are decomposed in the same way to facilitate the subsequent fusion of the image pyramids corresponding to the first image to be spliced ​​and the second image to be spliced.

[0095] Exemplarily, the first image to be stitched is subjected to Laplacian image decomposition to obtain the first image to be stitched pyramid; the second image to be stitched is subjected to Laplacian image decomposition to obtain the second image to be stitched pyramid; the weight image is subjected to Gaussian image decomposition to obtain the weight image pyramid. Specifically, Laplacian image decomposition and Gaussian image decomposition are existing image decomposition methods, which should be known to those skilled in the art, and will not be explained in detail in this embodiment.

[0096] Of course, the first image to be stitched may be subjected to Laplacian image decomposition to obtain the first image to be stitched pyramid; the second image to be stitched may be subjected to Laplacian image decomposition to obtain the second image to be stitched pyramid; the weight image may be subjected to Laplacian image decomposition to obtain the weight image pyramid; or the first image to be stitched may be subjected to Gaussian image decomposition to obtain the first image to be stitched pyramid; the second image to be stitched may be subjected to Gaussian image decomposition to obtain the second image to be stitched pyramid; the weight image may be subjected to Gaussian image decomposition to obtain the weight image pyramid; specifically, it should be determined according to the actual needs of image stitching, and this application does not impose any specific restrictions here.

[0097] It should be noted that when stitching high grayscale images, since the grayscale changes and contrast changes of high grayscale images are relatively subtle, the grayscale and image quality of different images may be different. Directly stitching the images together can easily make the images have obvious stitching marks or brightness differences, resulting in poor image quality and poor stitching effect.

[0098] Based on this, this embodiment performs image decomposition on the first expanded image and the second expanded image, and performs weighted fusion on the two acquired image pyramids to fuse the grayscale values ​​of each pixel of the first expanded image and the second expanded image to improve the stitching effect.

[0099] Specifically, the first image pyramid and the second image pyramid are weightedly fused, wherein the weights of the pixels in the first image pyramid and the second image pyramid are obtained based on the grayscale values ​​of the pixels in the weighted image pyramid. Exemplarily, the grayscale value of each pixel in the weighted image pyramid is the weight of the corresponding pixel in the first image pyramid, and the difference between 1 and the grayscale value of each pixel in the weighted image pyramid is the weight of the corresponding pixel in the second image pyramid.

[0100] Specifically, the grayscale value of each pixel in the fused image pyramid is expressed as:

[0101] LI k (i, j) = GI k(i,j)I 1k (i, j)+(1-GI k (i,j))I 2k (i, j)

[0102] Among them, LI k (i, j) is the grayscale value of the pixel point at the kth layer, ith row, and jth column in the fused image pyramid. k (i, j) is the gray value of the pixel point at the kth layer, ith row, and jth column in the weighted image pyramid. 1k (i, j) is the grayscale value of the pixel at the kth layer, ith row, and jth column in the first image pyramid. 2k (i, j) is the grayscale value of the pixel at the kth layer, the ith row, and the jth column in the second image pyramid.

[0103] Furthermore, the fused image pyramid is subjected to an inverse decomposition process to obtain a target image, wherein the target image is an image obtained by locally fusion of two spatially adjacent images to be spliced. The inverse decomposition process is a process of reconstructing an image based on the image pyramid.

[0104] Exemplarily, this embodiment performs inverse decomposition processing on the fused image pyramid as follows: adding adjacent layers of images of the fused image pyramid, specifically, adding grayscale values ​​of corresponding pixels of adjacent layers of images of the fused image pyramid, obtaining a new image pyramid with the number of layers reduced by 1 as the new fused image pyramid, and repeatedly performing the aforementioned step of adding adjacent layers of images until a single-layer image is finally obtained, and the image is used as the target image.

[0105] This embodiment locally fuses two spatially adjacent images to be spliced, so that the grayscale transition of high grayscale images is natural after splicing, and there is no obvious splicing hum or brightness difference, thereby improving image quality and enhancing image splicing effect.

[0106] It should be noted that, in the method for obtaining the overlapping area corresponding to the two spatially adjacent images to be stitched in step S300, since the target object 13 has a certain thickness, the side of the target object 13 close to the ray source 11 and the side close to the detector 12 do not completely overlap on the image to be stitched. Based on this, in order to further improve the accuracy of the overlapping area, in the above step S300, the overlapping area of ​​the two images to be stitched obtained based on the stitching displacement of the two spatially adjacent images to be stitched and the corresponding spatial position relationship is used as the initial overlapping area, and a more accurate overlapping area is further obtained through feature window comparison. Specifically, as Figure 5As shown, the step of obtaining the overlapping area of ​​the two images to be stitched based on the stitching displacement of the two images to be stitched that are adjacent in spatial position includes:

[0107] S310, setting two spatially adjacent images to be stitched to be a first image to be stitched and a second image to be stitched, and obtaining a first initial overlapping area of ​​the first image to be stitched and a second initial overlapping area of ​​the second image to be stitched based on a stitching displacement and a spatial position relationship between the first image to be stitched and the second image to be stitched.

[0108] Specifically, the method for obtaining the first initial overlapping area and the second initial overlapping area can be found in the above content, which will not be repeated here.

[0109] S320, selecting a plurality of feature windows in the first initial overlapping area, selecting a comparison window corresponding to the position of each feature window in the second initial overlapping area, and obtaining a comparison window group corresponding to each comparison window, finding the most similar window of each feature window from the corresponding comparison window group by a preset similarity determination method, and relatively moving the first image to be stitched and the second image to be stitched so that each feature window in the first initial overlapping area corresponds to the corresponding most similar window position in the second initial overlapping area, and taking the latest overlapping area of ​​the first image to be stitched and the second image to be stitched after the relative movement as the overlapping area of ​​the first image to be stitched and the second image to be stitched.

[0110] The comparison window group corresponding to the comparison window includes the comparison window and other windows adjacent to the comparison window, and the sizes of all windows are the same, that is, Figure 6 As shown, Figure 6 Each square in represents a window, and the comparison window group corresponding to the comparison window is a window group consisting of the comparison window and 8 windows that are close to and surround the comparison window, that is, the comparison window group corresponding to the comparison window includes 9 windows, which are 3*3 windows with the comparison window as the center.

[0111] Exemplarily, the size of all windows is 5*5 pixels.

[0112] It should be noted that, in this embodiment, the most similar window of each feature window is found from the corresponding comparison window group by a preset similarity determination method, which is performed on the basis of obtaining the first initial overlapping area and the second initial overlapping area. Since the first initial overlapping area and the second initial overlapping area are obtained based on the stitching displacement and spatial position relationship of the first image to be stitched and the second image to be stitched, the accuracy of the first initial overlapping area and the second initial overlapping area is relatively high, and the range of the feature window comparison is the comparison window group. Therefore, the amount of calculation for the comparison is small, the calculation difficulty is low, and the accuracy of the obtained overlapping area can be further improved, thereby improving the accuracy of the stitched image finally obtained, and achieving a better stitching effect.

[0113] Exemplarily, finding the most similar window to the feature window from the corresponding comparison window group by a preset similarity determination method includes: respectively calculating the normalized correlation coefficient between each window in the comparison window group and the feature window, and taking the window corresponding to the maximum value of the normalized correlation coefficient as the most similar window to the feature window.

[0114] Of course, the comparison and matching can also be performed by calculating the normalized square difference, or other methods for determining the degree of correlation between two windows, and this application does not make any specific limitations here.

[0115] Based on this, the image stitching method provided in this embodiment obtains the corresponding overlapping area through the stitching displacement of two spatially adjacent images to be stitched, so as to stitch the images. The method is simple and has low computational difficulty, avoids the large amount of calculation required for feature point matching, and effectively improves the efficiency of image stitching. At the same time, the application improves the accuracy of the overlapping area through feature window comparison in the overlapping area, thereby improving the stitching effect of the image, and avoids the grayscale inconsistency of high grayscale images affecting the image quality through weighted fusion, thereby further improving the stitching effect.

[0116] The protection scope of the image stitching method described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.

[0117] An embodiment of the present application also provides an image stitching device, which can implement the image stitching method described in the present application. However, the device for implementing the image stitching method described in the present application includes but is not limited to the structure of the image stitching device listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.

[0118] like Figure 7As shown, the image stitching device provided in this embodiment includes a sorting module 21 , an overlapping module 22 and a fusion module 23 .

[0119] Among them, the sorting module 21 is used to obtain a set of images to be stitched for the target object from the image detection system, obtain the spatial position relationship and time relationship of all the images to be stitched in the set of images to be stitched based on the relative motion trajectory, and sort the stitching positions of all the images to be stitched in the set of images to be stitched based on the corresponding spatial position relationship and time relationship to obtain the stitching position order of all the images to be stitched.

[0120] The overlapping module 22 is used to obtain the actual displacement of two spatially adjacent images to be stitched through the spatial positions of the images to be stitched based on the stitching position sequence, and convert the actual displacement through a preset displacement conversion method to obtain the stitching displacement; based on the stitching position sequence, obtain the overlapping area of ​​two adjacent images to be stitched based on the stitching displacement of the two adjacent images to be stitched.

[0121] The fusion module 23 is used to locally fuse two images to be stitched that are adjacent in spatial position based on the corresponding overlapping areas in sequence of stitching positions, so as to obtain a final stitched image.

[0122] like Figure 8 As shown, this embodiment further provides a terminal, including: a processor 31, used to run a computer program to implement the pet feeding plan acquisition method in the above embodiment; a memory 32, used to store the computer program. Optionally, the electronic device can be a mobile electronic device, or an electronic device or other device, which is not limited to uniqueness here.

[0123] The memory 32 is connected to the processor 31 via the system bus 33 and completes communication between them. The memory 32 is used to store computer programs, and the processor 31 is used to run computer programs so that the electronic device executes the pet feeding plan acquisition method in the above embodiment.

[0124] It should be noted that the system bus 33 mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The system bus 33 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as a client, a read-write library, and a read-only library).

[0125] The above-mentioned processor 31 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0126] In addition, this embodiment further provides a storage medium storing program instructions, which implement the image stitching method in the above embodiment when executed by a processor.

[0127] A person skilled in the art can understand that all or part of the steps in the method for implementing the above-mentioned embodiment can be completed by instructing the processor through a program, and the program can be stored in a storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above-mentioned storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.

[0128] The embodiment of the present application may also provide a computer program product, the computer program product including one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a storage medium, or transmitted from one storage medium to another storage medium, for example, the computer instructions may be transmitted from one website site, computer or data center to another website site, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode.

[0129] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.

[0130] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.

[0131] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.

[0132] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0133] To sum up, the present application converts the actual displacement into the stitching displacement through the preset displacement conversion method, and then obtains the overlapping area corresponding to the two spatially adjacent images to be stitched, for use in subsequent image stitching and fusion steps. The method is simple and has low computational complexity, which effectively improves the efficiency of image stitching. At the same time, the present application improves the accuracy of the obtained overlapping area while having a relatively small amount of calculation through feature window comparison, and effectively improves the image quality of the stitched image through weighted fusion, thereby achieving a better stitching effect.

[0134] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0135] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. An image stitching method, comprising: Acquire a set of images to be stitched of a target object from an image detection system, acquire spatial position relationships and time relationships of all the images to be stitched in the set of images to be stitched based on relative motion trajectories, and sequentially sort the stitching positions of all the images to be stitched in the set of images to be stitched based on the corresponding spatial position relationships and time relationships to acquire a stitching position sequence of all the images to be stitched; Based on the stitching position sequence, the actual displacement between two images to be stitched that are adjacent in spatial position is obtained through the spatial position of the images to be stitched, and all the actual displacements are converted into stitching displacements through a preset displacement conversion method; Based on the stitching position sequence, obtaining an overlapping area corresponding to the two images to be stitched based on the stitching displacement of two images to be stitched that are adjacent in spatial position; According to the stitching position sequence, two images to be stitched that are adjacent in spatial position are locally fused based on the corresponding overlapping areas in turn to obtain a final stitching image.

2. The image stitching method according to claim 1, characterized in that: The image detector is an X-ray detection system, which includes a ray source for emitting X-rays and a detector for receiving X-rays; The expression of the preset displacement conversion method is: S=SID / SOD*abs(diff), wherein S is the stitching displacement, SID is the distance from the ray source to the detector, SOD is the distance from the target object to the detector, diff is the actual displacement of the two adjacent images to be stitched in the spatial position, and abs(diff) is the absolute value of the actual displacement.

3. The image stitching method according to claim 1, characterized in that: The step of obtaining the overlapping area of ​​the two images to be stitched based on the stitching displacement of the two images to be stitched that are adjacent in spatial position includes: The two images to be stitched that are adjacent in spatial position are respectively set to be a first image to be stitched and a second image to be stitched, and based on the stitching displacement and spatial position relationship between the first image to be stitched and the second image to be stitched, a first initial overlapping area of ​​the first image to be stitched and a second initial overlapping area of ​​the second image to be stitched are obtained; Selecting a plurality of feature windows in the first initial overlapping area, selecting a comparison window corresponding to the position of each feature window in the second initial overlapping area, obtaining a comparison window group corresponding to each comparison window, finding the most similar window of each feature window from the corresponding comparison window group by a preset similarity determination method, relatively moving the first image to be stitched and the second image to be stitched so that each feature window in the first initial overlapping area corresponds to the corresponding most similar window position in the second initial overlapping area, and taking the latest overlapping area of ​​the first image to be stitched and the second image to be stitched after the relative movement as the overlapping area of ​​the first image to be stitched and the second image to be stitched; The comparison window group corresponding to the comparison window includes the comparison window and other windows adjacent to the comparison window, and the sizes of all windows are the same.

4. The image stitching method according to claim 3, characterized in that: Finding the most similar window to the feature window from the corresponding comparison window group by a preset similarity determination method includes: calculating the normalized correlation coefficient between each window in the comparison window group and the feature window respectively, and taking the window corresponding to the maximum value of the normalized correlation coefficient as the most similar window to the feature window.

5. The image stitching method according to claim 1, characterized in that: Locally fusing two images to be stitched that are adjacent in spatial position based on the corresponding overlapping area includes: Normalizing the two spatially adjacent images to be stitched respectively to serve as a first image to be fused and a second image to be fused, locally superimposing the first image to be fused and the second image to be fused based on the corresponding overlapping area to obtain a superimposed image, expanding the first image to be fused based on the superimposed image to obtain a first expanded image with the same size as the superimposed image, expanding the second image to be fused based on the superimposed image to obtain a second expanded image with the same size as the superimposed image, and constructing a weighted image with the same size as the superimposed image and a preset grayscale value; The first extended image is decomposed to obtain a first image pyramid, the second extended image is decomposed to obtain a second image pyramid, the weighted image is decomposed to obtain a weighted image pyramid, the grayscale weight corresponding to each pixel in the weighted image pyramid is obtained based on the grayscale value of each pixel in the weighted image pyramid, the first image pyramid and the second image pyramid are weightedly fused based on the grayscale weight of each pixel in the weighted image pyramid to obtain a fused image pyramid, and the fused image pyramid is inversely decomposed to obtain a target image, which is an image obtained by locally fusion of two spatially adjacent images to be spliced.

6. The image stitching method according to claim 5, characterized in that: Expanding the first image to be fused based on the overlay image to obtain a first expanded image with the same size as the overlay image, and expanding the second image to be fused based on the overlay image to obtain a second expanded image with the same size as the overlay image includes: An area of ​​the first image to be fused except the corresponding overlapping area is obtained as a first extended area, and an area of ​​the second image to be fused except the corresponding overlapping area is obtained as a second extended area. Based on the spatial position relationship between the first image to be fused and the second image to be fused, the second extended area is spliced ​​with the first image to be fused to obtain a first extended image, and the first extended area is spliced ​​with the second image to be fused to obtain a first extended image.

7. The image stitching method according to claim 5, characterized in that: Performing Laplacian image decomposition on the first image to be stitched to obtain the first image to be stitched pyramid; performing Laplacian image decomposition on the second image to be stitched to obtain the second image to be stitched pyramid; performing Gaussian image decomposition on the weighted image to obtain the weighted image pyramid.

8. An image acquisition device, characterized in that: It includes sorting module, overlapping module and fusion module; The sorting module is used to obtain a set of images to be stitched of the target object from the image detection system, obtain the spatial position relationship and time relationship of all the images to be stitched in the set of images to be stitched based on the relative motion trajectory, and sequentially sort the stitching positions of all the images to be stitched in the set of images to be stitched based on the corresponding spatial position relationship and time relationship to obtain the stitching position sequence of all the images to be stitched; The overlapping module is used to obtain the actual displacement of two spatially adjacent images to be stitched based on the stitching position sequence through the spatial positions of the images to be stitched, and to convert the actual displacement through a preset displacement conversion method to obtain the stitching displacement; based on the stitching position sequence, obtain the overlapping area of ​​two adjacent images to be stitched based on the stitching displacement of the two adjacent images to be stitched; The fusion module is used to locally fuse two images to be stitched that are adjacent in spatial position based on the corresponding overlapping areas in sequence of stitching positions, so as to obtain a final stitched image.

9. A terminal, characterized in that: include: A processor and a memory, wherein the memory is communicatively connected to the processor; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes the image acquisition method according to any one of claims 1 to 7.

10. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image acquisition method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Scanning electron microscope image splicing method and device, electronic equipment and storage medium

    CN119887519A