Seamless splicing method, system and device based on spatial weighted fusion and medium
By using a spatially weighted fusion method, pixel-level fusion is performed by utilizing the spatial position weights of each pixel in the image. This solves the stitching problem in dynamic scenes and moving targets in existing technologies, and achieves efficient and clear image stitching results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CRSC RESEARCH & DESIGN INSTITUTE GROUP CO LTD
- Filing Date
- 2026-01-05
- Publication Date
- 2026-05-15
AI Technical Summary
Existing image fusion technologies face challenges such as target misalignment, blurred fusion areas, ghosting, and obvious seams in dynamic scenes and with moving targets. They also lack semantic guidance for target regions, have high computational complexity, and poor applicability.
By using a spatially weighted fusion method, the spatial position weights of each pixel in the image are used to determine which pixels to include or exclude. Combined with image registration and brightness correction, pixel-level fusion is achieved, eliminating seams and ghosting, and maintaining the clarity and consistency of the stitched image.
It achieves efficient and seamless stitching under dynamic scenes and moving target conditions, reduces stitching marks, improves the clarity and consistency of stitched images, and reduces computational complexity.
Smart Images

Figure CN122048639A_ABST
Abstract
Description
Technical Field
[0001] This disclosure belongs to the field of image fusion technology, and in particular relates to a seamless stitching method, system, device and medium based on spatial weighted fusion. Background Technology
[0002] Image stitching and fusion technology is an important research direction in the fields of computer vision and image processing, and is widely used in many fields such as panoramic imaging, security monitoring, drone aerial photography, autonomous driving and 3D reconstruction. The traditional image stitching process usually includes three stages: image registration, geometric alignment and image fusion. Although this technology has been developed for many years, it still faces challenges such as target misalignment, blurred fusion areas, ghosting and obvious seams in dynamic scenes, non-calibrated environments or conditions with moving objects.
[0003] Currently, existing image fusion strategies mainly fall into the following categories: 1. A fusion method based on edge distance weighting These methods assume that the central region of an image is generally more stable and has higher image quality. Therefore, they design a weighting function with the image center as the maximum value and the edges as the minimum value, giving higher weight to the central region during fusion. The weighting function often takes the form of Gaussian distribution, bilinear function, or inverse distance function. This method has the advantages of being simple to implement and computationally efficient, and can smooth image transitions and reduce seam marks to a certain extent. However, most of these methods are only effective in static images or scenes with small parallax. When the target crosses the overlapping area, ghosting may still occur. Moreover, the fusion process is independent of the registration stage, lacks semantic guidance for fusion control, and cannot fully suppress inconsistencies caused by dynamic backgrounds or moving targets.
[0004] 2. Multi-band (pyramid) image fusion method This method, first proposed by Burt and Adelson, decomposes an image into sub-bands of different frequencies by constructing Gaussian and Laplacian pyramids, then fuses them separately, and finally reconstructs the image. This method can process the details and structure of the image at multiple scales, effectively improving the sense of hierarchy and edge sharpness of the fused image. It is particularly suitable for scenes with large brightness differences or complex image content, and the fusion effect is relatively natural. However, such methods usually do not have the ability to understand image structure, and are based only on pixel intensity operations, which limits their ability to handle moving targets, occluded areas, and parallax distortion. In addition, the pyramid decomposition and reconstruction process is relatively computationally intensive, making it unsuitable for real-time processing applications.
[0005] 3. Gradient Domain Fusion and Poisson Fusion Methods Gradient domain methods (such as Poisson fusion) construct an image gradient field and solve a Poisson equation within the fusion region to achieve a smooth transition of the fusion boundary along the gradient. This method is widely used in tasks such as image inpainting, stitching, and image cloning, and is ideal for eliminating fusion boundaries and brightness abrupt changes. A typical open-source implementation is OpenCV's seamlessClone(). However, this method relies on precise boundary extraction and region selection, lacks the ability to automatically identify foreground targets, and is prone to inconsistencies when faced with occlusion or moving objects. More importantly, Poisson fusion has high computational complexity, making it difficult to meet the efficiency requirements of multi-frame or large-scale image stitching, and is often used for static images or offline processing.
[0006] 4. Cutting and fusion method based on optimal seam Optimal stitching methods search for a stitching line in the overlapping region using energy functions (such as color difference, gradient change, etc.) to make the fused image visually the least abrupt. Graph-cut optimization and dynamic programming are often used for stitching line search. These methods perform well in avoiding obvious cuts and maintaining stitching consistency, and are commonly found in stitching tools such as Autostitch and Autopano. However, in multi-frame videos or dynamic scenes, if a moving target crosses the stitching region, the stitching path can easily "cut off" the target, causing breakage or repetition. More seriously, these methods generally lack the ability to perceive the semantics of the target, and the selection of stitching regions is based only on low-level features, which cannot avoid visual interference with key targets.
[0007] 5. Image stitching technology utilizing 3D information To overcome parallax and perspective distortion, some advanced stitching technologies incorporate 3D information, such as multi-view geometry, structured light, dense optical flow, or SLAM (Simultaneous Localization and Mapping). These technologies first create a 3D model of the scene and then project the image onto the reconstructed model for fusion. Such methods have theoretical advantages in handling complex scenes with large parallax and multiple depth levels, achieving high-precision alignment and structure preservation. For example, systems like Google Earth Studio and Microsoft Photosynth use 3D modeling combined with image projection for panoramic generation. However, these methods have the following limitations: First, they are highly dependent on camera calibration and require complex hardware configurations; second, 3D reconstruction algorithms (such as SfM and MVS) are inherently unstable and insensitive to areas with weak texture; third, they have high computational overhead, making real-time operation on ordinary devices difficult, and are more often used for offline mapping and high-end surveying applications.
[0008] In summary, while existing image fusion and stitching technologies have alleviated the seam and misalignment problems of traditional stitching to varying degrees, they still face the following bottlenecks overall: Lacking semantic guidance oriented towards the target region, it is impossible to accurately distinguish between spliced regions and key information regions; The fusion algorithm relies solely on pixel location or image intensity, failing to fully utilize the target structure distribution; It has limited support for dynamic scenes and cannot reliably handle the alignment and fusion of moving targets; Most methods require camera pre-calibration or 3D modeling, which results in poor applicability and complex implementation.
[0009] Therefore, combining object detection with image center spatial weight fusion to create a seamless stitching method is a feasible and preferred approach to fill the technical gap in target region fusion control in the field of two-dimensional image stitching. Summary of the Invention
[0010] To address the aforementioned issues, this disclosure provides a seamless stitching method, system, device, and medium based on spatial weighted fusion. By utilizing the spatial position weights of each pixel in the image to determine pixel selection, it aims to eliminate seams and ghosting to the greatest extent possible, maintain the clarity and consistency of the stitched image, and smoothly transition edge areas, thereby achieving the goal of eliminating obvious stitching traces.
[0011] Firstly, this disclosure provides a seamless stitching method based on spatial weighted fusion, the method comprising, Several source images of the target scene to be stitched are obtained from different shooting angles. Each source image to be stitched is preprocessed to obtain several target images to be stitched. Image registration technology is used to spatially align the target scene points corresponding to each target image to be stitched between different target images to obtain the target image to be fused. Calculate the spatial position weight matrix corresponding to each target image to be stitched, and perform pixel-level fusion on the target images to be fused based on each spatial position weight matrix to generate the initial output image after stitching; The initial output image is evaluated for brightness differences, and the initial output image is smoothed based on the evaluation results to obtain the target output image.
[0012] Furthermore, Each source image to be stitched is preprocessed to obtain several target images to be stitched, specifically including: Geometric correction, distortion correction, and projection transformation are performed sequentially on each source image to be stitched to obtain each target image to be stitched. In this process, based on the imaging model, each source image to be stitched is projected onto the target two-dimensional plane after geometric and distortion corrections to perform projection transformation, so as to obtain each target image to be stitched.
[0013] Furthermore, Image registration technology is used to spatially align the target scene points corresponding to each target image to be stitched between different target images to obtain the target image to be fused. Specifically, this includes: The target features of each image to be stitched are obtained, and feature point matching is performed between adjacent images to be stitched to obtain the initial matching results. The initial matching results are then processed using the RANSAC method to remove incorrect matches in order to obtain the target matching results. Based on the target matching results, the homography transformation matrix between each target image to be stitched is calculated, and the planar transformation is performed on each target image to be stitched based on the homography transformation matrix to obtain the target image to be fused.
[0014] Furthermore, Calculate the spatial location weight matrix corresponding to each target image to be stitched, specifically including: For any target image to be stitched, determine the coordinates of the center point of the target image; The actual weight of each pixel in the target image to be stitched is calculated based on the coordinates of the center point, and the spatial position weight matrix corresponding to the target image to be stitched is generated based on the actual weight of each pixel. In the spatial location weight matrix, each actual weight is inversely proportional to the actual distance from the coordinates of the center point.
[0015] Furthermore, The target images to be fused are fused pixel-level based on the weight matrices of each spatial location to generate a stitched initial output image, specifically including: Determine whether the regions corresponding to each pixel in the target image to be fused are overlapping regions; If any pixel corresponds to a non-overlapping region, then the non-overlapping pixel value corresponding to that pixel is added to the output image. For any pixel point, the region corresponding to the overlapping region is obtained, and the spatial position weight matrix of each target image to be stitched within the overlapping region is obtained. The actual weights of each target image to be stitched within the overlapping region are extracted based on the weight matrices of each spatial location. The actual weights extracted from the overlapping region are numerically compared, and the overlapping pixel values to be added to the output image are determined based on the comparison results. The initial output image is generated by adding non-overlapping pixel values to the output image and combining overlapping pixel values to the output image.
[0016] Furthermore, The actual weights extracted from the overlapping region are numerically compared, and the overlapping pixel values to be added to the output image are determined based on the comparison results. Specifically, this includes: Compare the numerical values of each actual weight within the overlapping region and determine the numerical difference between each actual weight; The actual method for adding the overlapping pixel values is determined based on the numerical difference, which is either the maximum weight selection method or the predetermined sequence number selection method.
[0017] Furthermore, Before performing pixel-level fusion on the target images to be fused, it is determined whether the overall brightness of the target images to be fused is consistent. Based on the overall brightness inconsistency, the color correction of the target image to be fused is performed according to the average brightness of the overlapping area.
[0018] Secondly, based on the same inventive concept, this disclosure provides a seamless stitching system based on spatial weighted fusion, the system comprising: The image acquisition and preprocessing module is used to acquire several source images of the target scene to be stitched according to different shooting angles, and to preprocess each source image to obtain several target images to be stitched. The image registration module uses image registration technology to spatially align the target scene points corresponding to each target image to be stitched between different target images to obtain the target image to be fused. The weight matrix calculation module is used to calculate the spatial location weight matrix corresponding to each target image to be stitched. The image fusion module performs pixel-level fusion on the target image to be fused based on the weight matrix of each spatial location to generate the stitched initial output image; The post-processing module is used to evaluate the brightness difference of the initial output image and perform transition smoothing processing on the initial output image according to the evaluation result to obtain the target output image.
[0019] Thirdly, this disclosure also provides an electronic device, including at least one processor and at least one memory electrically connected; The memory is electrically connected to the processor, wherein the memory stores instructions executable by at least one of the processors, the instructions being executed by at least one of the processors to enable at least one of the processors to perform any of the spatial weighted fusion-based seamless stitching methods described above.
[0020] Fourthly, this disclosure also provides a computer storage medium in which a computer program is stored; When the computer program is executed by the processor, it implements any of the spatial weighted fusion-based seamless stitching methods described above.
[0021] Fifthly, this disclosure also provides a computer program product, which is stored in at least one storage medium; The computer program product includes several instructions for causing at least one electronic device to execute any of the spatial weighted fusion-based seamless splicing methods described above.
[0022] Compared with the prior art, this disclosure has the following advantages: 1. Through precise preprocessing, the imaging errors of the source image were effectively corrected, laying a good foundation for subsequent stitching.
[0023] 2. By employing image registration techniques based on feature point matching and RANSAC to eliminate mismatches, the homography transformation matrix can be calculated with high precision, achieving accurate spatial alignment between images and reducing misalignment caused by differences in viewpoint.
[0024] 3. Utilize the spatial position weights of each pixel in the image to determine pixel selection, in order to eliminate seams and ghosting to the greatest extent and maintain the clarity and consistency of the stitched image; 4. By assigning weights to the distance of pixels from the image center, the advantages of the central area of each image are highlighted, and the edge areas are smoothly transitioned, thereby achieving the goal of no obvious stitching marks.
[0025] Other features and advantages of this disclosure will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the disclosure. The objects and other advantages of this disclosure may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 A flowchart illustrating a seamless stitching method based on spatial weighted fusion according to an embodiment of this disclosure is shown. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0029] Figure 1 A seamless stitching method based on spatial weighted fusion according to an embodiment of this disclosure is illustrated. For example... Figure 1 As shown in the figure, the seamless stitching method based on spatial weighted fusion in this disclosure includes the following steps: S1. Acquire several source images of the target scene to be stitched according to different shooting angles, and preprocess each source image to be stitched to obtain several target images to be stitched. In the embodiments of this disclosure, step S1 specifically includes: S11, geometric correction, distortion correction and projection transformation are performed on each source image to be stitched in sequence to obtain each target image to be stitched; In this process, based on the imaging model, each source image to be stitched is projected onto the target two-dimensional plane after geometric and distortion corrections to perform projection transformation, so as to obtain each target image to be stitched.
[0030] In the specific implementation process, multiple source images to be stitched are acquired. The source images can come from the same camera shooting the target scene from different angles, such as panoramic photos taken by handheld devices or aerial photos taken by drones from different angles. There is a certain overlap of the field of view between adjacent source images. Therefore, necessary preprocessing is performed on the source images, including distortion correction and projection transformation. The specific preprocessing process includes: according to the imaging model, projecting each corrected source image to be stitched onto a suitable two-dimensional plane. In this embodiment, cylindrical or spherical projection can be used for wide viewing angles to reduce geometric distortion.
[0031] In this embodiment, each source image to be stitched has undergone geometric correction, so that the overlapping areas can be aligned and coincident in the same plane coordinate system.
[0032] S2, Image registration technology is used to spatially align the target scene points corresponding to each target image to be stitched between different target images to obtain the target image to be fused; In the embodiments of this disclosure, step S2 specifically includes: S21, obtain the target features of each target image to be stitched, and perform feature point matching between adjacent target images to be stitched to obtain the initial matching result; S22, Remove erroneous matches from the initial matching results according to the RANSAC method to obtain the target matching results; S23, calculate the homography transformation matrix between each target image to be stitched according to the target matching result, and perform planar transformation on each target image to be stitched according to the homography transformation matrix to obtain the target image to be fused.
[0033] In the specific implementation process, image registration technology is used to align each target image to be stitched in space, so that the corresponding scene points can overlap between different images; In this embodiment, spatial alignment can be performed using feature point matching and transformation estimation algorithms; The specific alignment process includes: The target features of each image to be stitched are obtained using traditional feature extraction algorithms such as SIFT, ORB, or SURF, as well as deep learning-based feature extraction algorithms such as superpoint and xfeat. Feature point matching is performed between adjacent images using BFMatch or lightglue to obtain the initial matching results. The RANSAC method is used to remove incorrect matches to obtain the target matching results. Based on the target matching results, the homography transformation matrix H between each target image to be stitched is estimated. Then, a planar transformation is performed on each target image to align it with the reference coordinate system, so that all target images to be stitched achieve pixel-level alignment in the overlapping area. After this step, the input target images to be stitched will be in a state of near overlap in the overlapping part.
[0034] S3, calculate the spatial position weight matrix corresponding to each target image to be stitched, and perform pixel-level fusion on the target images to be fused based on each spatial position weight matrix to generate the initial output image after stitching; In the embodiments of this disclosure, step S3 specifically includes: S311, For any target image to be stitched, determine the coordinates of the center point of the target image; S312, calculate the actual weight of each pixel in the target image to be stitched according to the coordinates of the center point, and generate the spatial position weight matrix corresponding to the target image to be stitched according to the actual weight of each pixel. In the spatial location weight matrix, each actual weight is inversely proportional to the actual distance from the coordinates of the center point.
[0035] In the specific implementation process, a corresponding spatial position weight matrix is calculated for each target image to be stitched. In this embodiment, the setting of the spatial position weight matrix is determined based on the distance from the pixel to the center of the target image to be stitched. The specific setting process is as follows: pixels that are closer to the center of the target image to be stitched are assigned a larger weight; pixels that are farther away, i.e. closer to the edge of the target image to be stitched, are assigned a smaller weight. The calculation process of the spatial location weight matrix is as follows: 1) First, determine the coordinates of the center point of the target image to be stitched. For example, for a rectangular image, determine the center point coordinates (x_c, y_c) based on the midpoint of the image's width and height. In this embodiment, for an image that has undergone projection transformation, the center mapping result of the image before transformation is taken as the standard; 2) For any pixel (x, y) in the target image to be stitched, calculate the weight W of any pixel (x, y):
[0036] In the specific implementation process, if the distance between the center pixel and the center point coordinates is 0, then the weight is close to 1; if the distance between the edge pixel and the center point coordinates is close to the maximum, then the weight is close to 0. In this embodiment, other monotonically decreasing functions, such as Gaussian functions or quadratic functions, can also be used. This embodiment does not impose specific limitations on the way of assigning weights; it is only necessary to map the distance to the weights and ensure that the weights closer to the center are greater than the weights farther from the center.
[0037] Among them, any spatial position weight matrix Wi corresponds one-to-one with each pixel in the target image to be stitched, and stores the position weight of each pixel in the i-th target image to be stitched. For each target image to be stitched, the corresponding W1, W2, ..., Wn can be calculated respectively.
[0038] In the embodiments of this disclosure, step S3 further includes: S321, determine whether the regions corresponding to each pixel in the target image to be fused are overlapping regions; S322, for any pixel whose corresponding region is a non-overlapping region, add the non-overlapping pixel value corresponding to that pixel to the output image; S323, for any pixel point, the corresponding region is an overlapping region, obtain the spatial position weight matrix of each target image to be stitched within the overlapping region; S324, extract the actual weights of each target image to be stitched within the overlapping region based on the weight matrices of each spatial location; S325, Compare the actual weights extracted in the overlapping region, and determine the overlapping pixel values to be added to the output image based on the comparison results; S326, the output image is added based on each non-overlapping pixel value and the output image is combined with each overlapping pixel value to generate the initial output image.
[0039] In the specific implementation process, the position of each pixel in the output panoramic image, i.e. the target image to be fused, is traversed. For pixels that do not belong to any overlapping area, i.e. only one target image to be stitched covers the position, the pixel value of the target image to be stitched, i.e. the non-overlapping pixel value, is directly added to the output image. When performing pixel-level fusion on the target images to be fused, the focus is on processing overlapping areas. During fusion, pre-calculated weight matrices for each spatial location are used to determine which frame of the image the pixel value is obtained from for each pixel position. For pixel locations that are covered by the overlap of two or more images, extract the weight values w_1, w_2, ..., w_n of each target image to be stitched at this location (these weights come from the spatial position weight matrix corresponding to each target image to be stitched).
[0040] Specifically, the actual weights extracted from the overlapping region are numerically compared, and the overlapping pixel values to be added to the output image are determined based on the comparison results. This includes: S3251, compare the numerical values of each actual weight within the overlapping area and determine the numerical difference between each actual weight; S3252, the actual addition method of the overlapping pixel value is determined based on the numerical difference as either the maximum weight selection method or the predetermined sequence number selection method.
[0041] In the specific implementation process, when the weights are not much different, that is, the numerical difference is small, it is equivalent to a certain pixel being located in the middle of the transition between the weights of the two images. In this case, the pixel value of the overlapping area can be added according to the predetermined sequence selection method; when the weights are much different, the pixel value of the overlapping area can be added according to the maximum weight selection method. In this embodiment, the predetermined sequence number selection method is as follows: select one of the images according to predetermined rules, such as selecting the first image or selecting the image with the smaller sequence number, to ensure certainty; The maximum weight selection method is as follows: compare the weights and select the pixel of the image with the largest weight as the fusion result at that position. That is, each pixel in the overlapping area is provided by the image that is "closer to the center of its own image". The selected pixel values are written to the corresponding positions in the output image. By making decisions on each pixel in the entire overlapping area, the fusion and overlay of all target images to be stitched is finally completed.
[0042] Specifically, through the above process, the overlapping area is divided into an invisible "fusion boundary" based on the spatial position weight matrix. The part closer to the center of the first image mainly uses the pixels of the first image, and the part closer to the center of the second image uses the pixels of the second image. Since the weight changes continuously with distance, the image transition is also gradual. In the end, each position comes from only the original pixels of one image, so there will be no obvious stitching seam or ghosting. Compared with simple averaging, the pixels are not linearly superimposed in the overlapping area, but a single source is selected to avoid blurring or double images caused by the superposition of multiple images.
[0043] S4, perform brightness difference evaluation on the initial output image, and perform transition smoothing processing on the initial output image according to the evaluation result to obtain the target output image; Specifically, in this embodiment, the initial output image has fused all the effective areas of the source images to be stitched, and should present a result of expanded field of view and natural connection. In most cases, step S4 can ensure no obvious seams. However, in this embodiment, the brightness difference of the initial output image is judged. If there are still slight brightness differences, some transition smoothing processing is performed on the initial output image near the fusion boundary to eliminate subtle edges that may be perceived by the human eye. In this embodiment, a narrow-band transition region can be used to perform low-weight mixing on the pixels on both sides, or a local color smoothing filter can be applied to achieve smooth transition processing. The specific method of smooth transition processing is not limited in this embodiment.
[0044] Specifically, in this embodiment, before performing pixel-level fusion on the target images to be fused, it is determined whether the overall brightness of the target images to be fused is consistent. Based on the overall brightness inconsistency, the color correction of the target image to be fused is performed according to the average brightness of the overlapping area.
[0045] In the specific implementation process, if the overall brightness of the input target images to be fused is inconsistent, a color correction step is added before fusion. The specific process of the color correction step is as follows: adjust the gain and color of each target image to be stitched according to the average brightness of the overlapping area so that their brightness matches in the overlapping area, and then perform the above fusion to minimize the visibility of the seam.
[0046] Specifically, the stitching method provided by the present invention, following the above implementation steps, has a clear process and limited calculation steps, making it easy to implement on a computer or embedded device. In particular, since the spatial position weight matrix can be pre-calculated offline when the image size is known or quickly generated during runtime, and the fusion decision process mainly involves simple comparison and assignment operations, it has the potential for real-time processing. It abandons complex 3D modeling or frequency domain processing and is completed entirely in the two-dimensional pixel plane and pixel value domain, making it suitable for scenarios with high speed requirements, such as large target panoramic stitching and video frame stitching.
[0047] Based on the same inventive concept, this disclosure also provides a seamless stitching system based on spatial weighted fusion corresponding to the above-described method, including: The image acquisition and preprocessing module is used to acquire several source images of the target scene to be stitched according to different shooting angles, and to preprocess each source image to obtain several target images to be stitched. The image registration module uses image registration technology to spatially align the target scene points corresponding to each target image to be stitched between different target images to obtain the target image to be fused. The weight matrix calculation module is used to calculate the spatial location weight matrix corresponding to each target image to be stitched. The image fusion module performs pixel-level fusion on the target image to be fused based on the weight matrix of each spatial location to generate the stitched initial output image; The post-processing module is used to evaluate the brightness difference of the initial output image and perform transition smoothing processing on the initial output image according to the evaluation result to obtain the target output image.
[0048] Based on the same inventive concept, this disclosure also provides an electronic device. The electronic device of this disclosure includes at least one processor and at least one memory electrically connected to the processor. The memory stores instructions executable by the at least one processor, which, when executed, enables the at least one processor to perform the spatially weighted fusion-based seamless stitching method described above.
[0049] It should be noted that the electrical connections between the various units mentioned above do not necessarily represent the connections between lines. Any indirect connection method can be applied to the embodiments of this disclosure as long as it achieves the purpose of this disclosure.
[0050] Based on the same inventive concept, this disclosure also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the seamless splicing method based on spatial weighted fusion as described above.
[0051] Based on the same inventive concept, this disclosure also provides a computer program product stored in at least one storage medium; the computer program product includes several instructions to cause at least one computer device to execute the seamless splicing method based on spatial weighted fusion as described above.
[0052] Although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A seamless stitching method based on spatial weighted fusion, characterized in that, The method includes: Several source images of the target scene to be stitched are obtained from different shooting angles. Each source image to be stitched is preprocessed to obtain several target images to be stitched. Image registration technology is used to spatially align the target scene points corresponding to each target image to be stitched between different target images to obtain the target image to be fused. Calculate the spatial position weight matrix corresponding to each target image to be stitched, and perform pixel-level fusion on the target images to be fused based on each spatial position weight matrix to generate the initial output image after stitching; The initial output image is evaluated for brightness differences, and the initial output image is smoothed based on the evaluation results to obtain the target output image.
2. The method according to claim 1, characterized in that, Each source image to be stitched is preprocessed to obtain several target images to be stitched, specifically including: Geometric correction, distortion correction, and projection transformation are performed sequentially on each source image to be stitched to obtain each target image to be stitched. In this process, based on the imaging model, each source image to be stitched is projected onto the target two-dimensional plane after geometric and distortion corrections to perform projection transformation, so as to obtain each target image to be stitched.
3. The method according to claim 1, characterized in that, Image registration technology is used to spatially align the target scene points corresponding to each target image to be stitched between different target images to obtain the target image to be fused. Specifically, this includes: The target features of each image to be stitched are obtained, and feature point matching is performed between adjacent images to be stitched to obtain the initial matching results. The initial matching results are then processed using the RANSAC method to remove incorrect matches in order to obtain the target matching results. Based on the target matching results, the homography transformation matrix between each target image to be stitched is calculated, and a planar transformation is performed on each target image to be stitched based on the homography transformation matrix to obtain the target image to be fused.
4. The method according to claim 1, characterized in that, Calculate the spatial location weight matrix corresponding to each target image to be stitched, specifically including: For any target image to be stitched, determine the coordinates of the center point of the target image; The actual weight of each pixel in the target image to be stitched is calculated based on the coordinates of the center point, and the spatial position weight matrix corresponding to the target image to be stitched is generated based on the actual weight of each pixel. In the spatial location weight matrix, each actual weight is inversely proportional to the actual distance from the coordinates of the center point.
5. The method according to claim 4, characterized in that, The target images to be fused are fused pixel-level based on the weight matrices of each spatial location to generate a stitched initial output image, specifically including: Determine whether the regions corresponding to each pixel in the target image to be fused are overlapping regions; If any pixel corresponds to a non-overlapping region, then the non-overlapping pixel value corresponding to that pixel is added to the output image. For any pixel point, the region corresponding to the overlapping region is obtained, and the spatial position weight matrix of each target image to be stitched within the overlapping region is obtained. The actual weights of each target image to be stitched within the overlapping region are extracted based on the weight matrices of each spatial location. The actual weights extracted from the overlapping region are numerically compared, and the overlapping pixel values to be added to the output image are determined based on the comparison results. The initial output image is generated by adding non-overlapping pixel values to the output image and combining overlapping pixel values to the output image.
6. The method according to claim 5, characterized in that, The actual weights extracted from the overlapping region are numerically compared, and the overlapping pixel values to be added to the output image are determined based on the comparison results. Specifically, this includes: Compare the numerical values of each actual weight within the overlapping region and determine the numerical difference between each actual weight; The actual method for adding the overlapping pixel values is determined based on the numerical difference, which is either the maximum weight selection method or the predetermined sequence number selection method.
7. The method according to claim 1, characterized in that, Before performing pixel-level fusion on the target images to be fused, it is determined whether the overall brightness of the target images to be fused is consistent. Based on the overall brightness inconsistency, the color correction of the target image to be fused is performed according to the average brightness of the overlapping area.
8. A seamless splicing system based on spatial weighted fusion, characterized in that, The system includes: The image acquisition and preprocessing module is used to acquire several source images of the target scene to be stitched according to different shooting angles, and to preprocess each source image to obtain several target images to be stitched. The image registration module uses image registration technology to spatially align the target scene points corresponding to each target image to be stitched between different target images to obtain the target image to be fused. The weight matrix calculation module is used to calculate the spatial location weight matrix corresponding to each target image to be stitched. The image fusion module performs pixel-level fusion on the target image to be fused based on the weight matrix of each spatial location to generate the stitched initial output image; The post-processing module is used to evaluate the brightness difference of the initial output image and perform transition smoothing processing on the initial output image according to the evaluation result to obtain the target output image.
9. An electronic device comprising at least one processor and at least one memory electrically connected to each other; The memory is electrically connected to the processor, wherein... The memory stores instructions executable by at least one of the processors, which enable the at least one processor to perform the spatially weighted fusion-based seamless stitching method as described in any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer-readable storage medium stores a computer program. When the computer program is executed by the processor, it implements the seamless stitching method based on spatial weighted fusion as described in any one of claims 1-7.
11. A computer program product, characterized in that, The computer program product is stored in at least one storage medium; The computer program product includes several instructions for causing at least one electronic device to execute the seamless splicing method based on spatial weighted fusion as described in any one of claims 1-7.