Image fusion method, device and equipment and computer readable storage medium

The source image and target image are regionally selected and fused by using a weighted adaptive Poisson fusion model, which solves the problems of poor image fusion effect and low efficiency in the existing technology, achieves seamless fusion and rapid application, and is suitable for efficient image processing in industrial scenarios.

CN120672591APending Publication Date: 2025-09-19HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510823380.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing image fusion methods have poor effects and low efficiency. Existing technologies cannot meet the needs of tools for rapid application. Existing technology tools are complex to operate and require multiple manual adjustments.

Method used

A weighted adaptive Poisson fusion model is adopted to construct a weighted adaptive Poisson fusion model by selecting the mask area based on the source image and the target area based on the target image, and using the dynamic weight adjustment mechanism to perform image fusion, thereby eliminating the hard boundary effect and retaining the edge direction characteristics.

Benefits of technology

It achieves seamless image fusion, improves fusion effects, simplifies operation procedures, is suitable for rapid application and batch processing in industrial scenarios, and improves efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120672591A_ABST
    Figure CN120672591A_ABST
Patent Text Reader

Abstract

The invention discloses an image fusion method, device and equipment and a computer readable storage medium, and is applied to the technical field of computers, and the method comprises the steps: carrying out the region selection based on a source image, and obtaining a mask region; the mask region comprises a defect region; performing region selection based on the target image to obtain a target region; and fusing the mask region in a target region of the target image by using a weighted adaptive Poisson fusion model to obtain a fused image. According to the method, the mask region of the source image and the target region of the target image are fused based on the weighted adaptive Poisson fusion model, and the features of the mask region in the source image can be seamlessly fused into the target region of the target image while the features of the mask region in the source image are kept. According to the fusion method, the hard boundary effect of a traditional method is eliminated, meanwhile, edge direction features are better reserved, and the fusion effect of images with clear structures is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an image fusion method, apparatus, device, and computer-readable storage medium. Background Art

[0002] The principle of image fusion is to generate a new image by embedding a target area in the source image into the background image to achieve a smooth transition and seamless fusion between the target image and the background image, thereby improving the visual effect of the fusion transition zone. At present, image fusion methods mainly include deep learning fusion methods and fusion methods based on multi-scale decomposition. The deep learning fusion method achieves intelligent fusion through feature extraction and reconstruction. This method requires a large amount of training data, consumes a lot of computing resources, and takes a long time. The multi-scale decomposition-based fusion method achieves image information fusion through frequency domain decomposition. This method is prone to artifacts and has insufficient edge preservation capabilities. Existing fusion tools have a high threshold for use and cannot be quickly applied.

[0003] Therefore, how to improve the image fusion effect and efficiency is a technical problem that needs to be solved urgently. Summary of the Invention

[0004] In view of this, an object of the present invention is to provide an image fusion method, apparatus, device and computer-readable storage medium to solve the problems of poor image fusion effect and low efficiency in the prior art.

[0005] To solve the above technical problems, the present invention provides an image fusion method, comprising:

[0006] Performing region selection based on the source image to obtain a mask region; the mask region includes a defect region;

[0007] Perform region selection based on the target image to obtain the target region;

[0008] The mask region is fused with the target region of the target image using a weighted adaptive Poisson fusion model to obtain a fused image.

[0009] Optionally, the process of constructing the weighted adaptive Poisson fusion model includes:

[0010] Based on the Poisson model, a dynamic weight adjustment mechanism is performed on the boundary and mask areas respectively to obtain the weighted adaptive Poisson fusion model;

[0011] The Poisson model is:

[0012] ;

[0013] The weighted adaptive Poisson fusion model is:

[0014] ;

[0015] in, represents the Laplacian operator of the fused image I; div represents the divergence operation; is the gradient of the source image; is the mask area; is the boundary of the mask area; is the pixel value of the fused image on the boundary; is the pixel value of the boundary on the target image; is the dynamic adaptive weight parameter within the mask area; is the dynamic adaptive weight parameter on the boundary; is the gradient of the target image; The pixel value of the boundary on the source image.

[0016] Optionally, dynamically adaptive weight parameters within the mask area for:

[0017] ;

[0018] Where k is the slope control factor and T is the gradient amplitude threshold parameter.

[0019] Optionally, dynamically adaptive weight parameters at the boundaries for:

[0020] ;

[0021] Where R is the width of the transition zone; σ is the smoothing coefficient; is the distance from the internal pixel to the boundary of the target area.

[0022] Optionally, before using a weighted adaptive Poisson fusion model to fuse the mask area with the target area of ​​the target image to obtain a fused image, the method further includes:

[0023] Acquire an operation mode for image generation; the operation modes include a single-image generation mode and a batch generation mode; the single-image generation mode includes a single-image, multi-position, single-image generation mode and a single-image, single-position, single-image generation mode; the batch generation mode includes a single-image, multi-position, batch generation mode and a multi-image automatic batch generation mode; the single image is one target image, and the multi-image is multiple different target images;

[0024] Accordingly, the mask area is fused with the target area of ​​the target image using a weighted adaptive Poisson fusion model to obtain a fused image, including:

[0025] According to the operation mode, the weighted adaptive Poisson fusion model is used to fuse the mask area with the target area of ​​the target image to obtain a fused image.

[0026] Optionally, according to the operation mode, using the weighted adaptive Poisson fusion model, the mask area is fused with the target area of ​​the target image to obtain a fused image, including:

[0027] When the operation mode is a multi-image automatic batch generation mode, randomly selecting an image from a folder for region selection to obtain the target region;

[0028] The weighted adaptive Poisson fusion model is used to fuse the mask area on the target area of ​​all images in the folder to obtain multiple fused images in batches.

[0029] Optionally, before using a weighted adaptive Poisson fusion model to fuse the mask area with the target area of ​​the target image to obtain a fused image, the method further includes:

[0030] Obtaining a processing method for the mask area; the processing method includes at least one of random rotation and random mirror transformation;

[0031] Accordingly, the mask area is fused with the target area of ​​the target image using a weighted adaptive Poisson fusion model to obtain a fused image, including:

[0032] According to the processing method, the weighted adaptive Poisson fusion model is used to fuse the mask area with the target area of ​​the target image to obtain a fused image.

[0033] The present invention also provides an image fusion device, comprising:

[0034] A mask region selection module, configured to select a region based on a source image to obtain a mask region; the mask region includes a defect region;

[0035] A target region selection module is used to select a region based on a target image to obtain a target region;

[0036] The image fusion module is used to fuse the mask area with the target area of ​​the target image by using a weighted adaptive Poisson fusion model to obtain a fused image.

[0037] The present invention also provides an image fusion device, comprising:

[0038] Memory for storing computer programs;

[0039] A processor is used to implement the above-mentioned image fusion method when executing the computer program.

[0040] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are loaded and executed by a processor, the image fusion method as described above is implemented.

[0041] It can be seen that the present invention obtains a mask area by performing region selection based on the source image; the mask area includes a defect area; performing region selection based on the target image to obtain a target area; and using a weighted adaptive Poisson fusion model, the mask area is fused with the target area of ​​the target image to obtain a fused image. The present invention fuses the mask area of ​​the source image and the target area of ​​the target image based on the weighted adaptive Poisson fusion model, while maintaining the characteristics of the mask area in the source image and seamlessly fusing it into the target area of ​​the target image. This fusion method eliminates the hard boundary effect of traditional methods while better preserving edge direction characteristics, significantly improving the fusion effect of images with clear structures.

[0042] In addition, the present invention also provides an image fusion device, equipment and computer-readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0044] Figure 1 A flowchart of an image fusion method provided by an embodiment of the present invention;

[0045] Figure 2 This is an example flow chart of a single-image, multi-position, single-image generation mode provided by an embodiment of the present invention;

[0046] Figure 3 An example flow chart of a graph multi-position batch generation mode provided by an embodiment of the present invention;

[0047] Figure 4 An example flow chart of a multi-image automatic batch processing mode provided by an embodiment of the present invention;

[0048] Figure 5 An example flow chart of a random transformation process provided by an embodiment of the present invention;

[0049] Figure 6An example flow chart of an image fusion method provided in an embodiment of the present invention;

[0050] Figure 7 A schematic structural diagram of an image fusion device provided by an embodiment of the present invention;

[0051] Figure 8 A schematic structural diagram of an image fusion device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0053] Currently, image fusion methods primarily include deep learning-based fusion methods and multi-scale decomposition-based fusion methods. Deep learning-based fusion methods, such as GAN (Generative Adversarial Network) networks and autoencoder structures, achieve intelligent fusion through feature extraction and reconstruction. However, these methods require a large amount of image and training resources, are not readily available, and are inconvenient. They consume large amounts of computing resources and require long training times, failing to meet the efficiency requirements of industrial scenarios. Multi-scale decomposition-based fusion methods, such as pyramid transforms and wavelet transforms, achieve image information fusion through frequency domain decomposition. These methods are prone to artifacts, lack edge preservation capabilities, and require complex parameter adjustments, resulting in a high barrier to entry. Existing fusion tools, however, have a high barrier to entry and cannot be quickly applied. Furthermore, fusion tools require multiple manual adjustments during use, making them inconvenient for industrial scenarios.

[0054] In order to solve the above problems, the present invention provides an image fusion method, which is not only applicable to the field of industrial defect fusion, but also can be generated in multiple fields such as advertising design, film and television special effects, graphic design, etc. Figure 1 , Figure 1 This is a flowchart of an image fusion method provided by an embodiment of the present invention. The method may include:

[0055] S101: performing region selection based on a source image to obtain a mask region; the mask region includes a defect region.

[0056] The executor of this embodiment is a terminal. This embodiment does not limit the type of terminal, as long as it can complete the operation of the image fusion method. This embodiment generates a source area mask, that is, a mask area, by selecting the area to be fused on the source image. The user can select the area of ​​the source image in the user operation interface to obtain the mask area. The user operation interface is a dual-view interface, which is used to implement a simple workflow of "select source image-select target area". One of the views is the source image display area, and the other view is the target image display area. It should be noted that the source image in this embodiment is an image with defect features. The source image is an industrial image collected in an industrial field. For example, the defect feature can be a scratch.

[0057] S102: Performing region selection based on the target image to obtain a target region.

[0058] It should be noted that the target image in this embodiment can be an image without defect features. The target image and the source image in this embodiment can be images of the same color or different colors. That is, the target image and the source image can be images of the same type of industrial product or different types of industrial products. For example, the industrial product can be a pipe. It should also be noted that the region selected in steps S101 and S102 can be randomly selected, and there is no limit on its size.

[0059] S103: Using a weighted adaptive Poisson fusion model, the mask region is fused with the target region of the target image to obtain a fused image.

[0060] Currently, in traditional fusion methods, the accuracy of region selection directly affects the final fusion effect. For example, traditional region selection uses fixed threshold segmentation (such as the GrabCut algorithm), which makes it difficult to precisely control the boundaries of the fusion region during image fusion. However, the fusion method of the present application does not require region selection accuracy. Existing Poisson equation fusion technology uses seamlessClone and its derivative algorithms to achieve seamless fusion through gradient domain processing. This fusion method can preserve the texture features of the source image while achieving a natural transition. However, because it relies entirely on the gradient of the source image, the target image may be distorted when there are large differences in texture or illumination. Therefore, this embodiment further optimizes and improves it by constructing a weighted adaptive Poisson fusion model. This model dynamically blends the target gradient in gradient processing and switches the boundary condition from a fixed target boundary value to an adaptive transition boundary. This eliminates the hard boundary effect of traditional methods while better preserving edge direction characteristics, significantly improving the fusion effect of images with clear structures.

[0061] Furthermore, the process of constructing the weighted adaptive Poisson fusion model may include the following steps:

[0062] Based on the Poisson model, a dynamic weight adjustment mechanism is performed on the boundary and mask areas respectively to obtain a weighted adaptive Poisson fusion model.

[0063] Among them, the Poisson model is:

[0064] .

[0065] in, The Laplace operator representing the fused image I is a second-order derivative operator that describes the "local variation intensity" of image pixels. It is the sum of the second-order partial derivatives in the horizontal and vertical directions, representing the "curvature" or "convexity" of the image. If the brightness of a point is brighter (or darker) than its surroundings, then It will be bigger (or smaller).

[0066] is the gradient of the source image, which is a two-dimensional vector field used to describe the change direction and change intensity of the source image at each pixel position.

[0067] is the boundary of the mask area, that is, the "contour line" of the mask area.

[0068] is the mask area; div represents the divergence operation; is the pixel value of the fused image on the boundary; is the pixel value of the boundary on the target image. At the boundary of the fusion area of ​​the fusion image, the pixel value of the fusion image I is equal to the pixel value of the target image The pixel value of .

[0069] As can be seen from the above formula, the Poisson model is isotropic, which is equivalent to the weighted average in all directions and has no directional preference for image structure.

[0070] The improved weighted adaptive Poisson fusion model is:

[0071] ;

[0072] in, is the dynamic adaptive weight parameter within the mask area; is the dynamic adaptive weight parameter on the boundary; is the gradient of the target image; The pixel value of the boundary on the source image.

[0073] The improved weighted adaptive Poisson fusion model demonstrates that this embodiment employs a dynamic weight adjustment mechanism for both the mask region and the boundary, enabling better fusion of images from both regions. This fusion model dynamically blends target gradients in gradient processing, switches boundary conditions from fixed target boundary values ​​to adaptive transition boundaries, and transitions the weight mechanism from no explicit weights to dynamic dual-parameter adjustment (α, β). The parameter type changes from a global constant to a spatially variable function, and the mathematical characteristics change from linear equations to nonlinear coupled systems. This fusion model eliminates the hard boundary effects of traditional methods while better preserving edge directional features, significantly improving the fusion of images with clear structures.

[0074] Furthermore, the above dynamic adaptive weight parameters in the mask area for:

[0075] ;

[0076] Among them, k is the slope control factor, also known as the "steepness parameter", which is used to control the speed of change of the Sigmoid curve. k determines How to quickly change from "using target image information" to "using source image structure"? In industrial scenarios, the relatively stable value tested is [10, 20]. In this embodiment, K can be 12.

[0077] T is the gradient amplitude threshold parameter, which is used to control when to start introducing the structural information of the source image into the fusion.

[0078] Furthermore, the above dynamic adaptive weight parameters on the boundary for:

[0079] ;

[0080] Where R is the width of the transition region (typical value is 5-10 pixels); σ is the smoothing coefficient (default is 0.3); It is the shortest Euclidean distance from the internal pixel to the boundary of the target area, that is, the distance from the internal pixel to the nearest point on the entire boundary.

[0081] Furthermore, before fusing the mask region with the target region of the target image using the weighted adaptive Poisson fusion model to obtain the fused image, the following steps may be further included:

[0082] Acquire the operation mode of image generation; the operation modes include single generation mode and batch generation mode; the single generation mode includes single image multi-position single generation mode and single image single position single generation mode; the batch generation mode includes single image multi-position batch generation mode and multi-image automatic batch generation mode; single image refers to one target image, and multi-image refers to multiple different target images;

[0083] Accordingly, the mask area is fused with the target area of ​​the target image using a weighted adaptive Poisson fusion model to obtain a fused image, including:

[0084] According to the operation mode, the weighted adaptive Poisson fusion model is used to fuse the mask area in the target area of ​​the target image to obtain a fused image.

[0085] Currently, existing image processing tools suffer from batch processing flaws, lack dynamic adaptability, and are inconvenient for use in industrial scenarios. Specifically, existing image processing tools lack the ability to intelligently batch process data to meet the needs of diverse scenarios. Batch processing is inefficient and cannot meet the demands of large-scale applications. However, this embodiment can generate both single and batch fused images, improving efficiency while also meeting the diverse needs of users.

[0086] (1) Single-image multi-position single-image generation mode: The target area selected on only one target image is fused with the selected mask area to generate a fused image. This fused image is fused with multiple mask areas and has multiple defects. For the specific operation process, please refer to Figure 2 , Figure 2 This is a flowchart illustrating a single-image, multi-position, single-image generation mode provided by an embodiment of the present invention. The user loads the source and target images through the interface; selects the area to be fused (the mask area) by drawing a rectangular box on the source image; specifies the fusion location (the target area) by drawing a rectangular box on the target image; the system automatically calculates the fusion center point; executes the WAPF-Possion seamless fusion algorithm (the weighted adaptive Poisson fusion model); and finally displays and saves the fused image.

[0087] (2) Single-image, single-position, single-image generation mode: The target area selected on only one target image is fused with the selected mask area to generate a fused image. This fused image is fused with a mask area, which has a defect.

[0088] (3) Single image multi-position batch generation mode: Random batch fusion is performed within the target area of ​​a target image to generate a preset number of fused images. Figure 3 , Figure 3This diagram illustrates an example process for batch generation of multiple locations in an image, as provided by an embodiment of the present invention. The user sets batch parameters (number of images to be generated, transformation options); the system automatically applies random transformations to the target regions; it then fuses the images in different target regions; it iterates through the fusion algorithm; it automatically names and saves the results according to the rules; and it displays processing progress and statistical information.

[0089] (4) Multi-image automatic batch generation mode: Random batch fusion generates a preset number of fused images within a fixed target area on different target images in a folder. The above functions all enable automatic naming and saving functions. For details, please refer to Figure 4 , Figure 4 This is an example flow chart for an automatic batch processing mode for multiple images, provided by an embodiment of the present invention. The user specifies a folder for storing target images; sets the number of images to be generated for each image; the system traverses all supported target images in the folder; performs a specified number of fusion operations on each target image; generates and saves the results to a specified directory; and generates a processing report.

[0090] Furthermore, before fusing the mask region with the target region of the target image using the weighted adaptive Poisson fusion model to obtain the fused image, the following steps may be further included:

[0091] Obtaining a processing method for the mask area; the processing method includes at least one of random rotation and random mirror transformation;

[0092] Accordingly, the weighted adaptive Poisson fusion model is used to fuse the mask area with the target area of ​​the target image to obtain a fused image, including:

[0093] According to the processing method, the weighted adaptive Poisson fusion model is used to fuse the mask area in the target area of ​​the target image to obtain a fused image.

[0094] Specifically, you can refer to Figure 5 . Figure 5 This is an example diagram of a random transformation process flow provided by an embodiment of the present invention. The random transformation process sub-flow, whereby the mask region is processed using a random transformation method, represents a method that uses random rotation and mirroring to achieve coordinate mapping changes to the relevant region. Similarly, the random transformation process can also be displayed on the display interface for user selection.

[0095] The image fusion method provided by the embodiment of the present invention is applied to obtain a mask area by performing area selection based on the source image; the mask area includes a defect area; performing area selection based on the target image to obtain a target area; and using a weighted adaptive Poisson fusion model, the mask area is fused with the target area of ​​the target image to obtain a fused image. The present invention fuses the mask area of ​​the source image and the target area of ​​the target image based on the weighted adaptive Poisson fusion model, and while maintaining the features of the mask area in the source image, it can also seamlessly fuse it into the target area of ​​the target image. This fusion method eliminates the hard boundary effect of the traditional method while better retaining the edge direction features, and significantly improves the fusion effect of images with clear structures. This method can be quickly applied in industrial scenarios, and can also generate fused images in batches, greatly improving the fusion efficiency and fusion accuracy. In addition, the operation threshold is low and can be used without professional learning.

[0096] In order to make the present invention easier to understand, please refer to Figure 6 , Figure 6 An example flow chart of an image fusion method provided in an embodiment of the present invention may specifically include:

[0097] Start the image fusion system, load the source image, and perform region selection on the source image to obtain the mask region. Then load the image and perform region selection on the target image to obtain the target region. Select the operation mode: single fusion for single fusion; batch generation for batch generation, set batch parameters for batch fusion; and folder processing for folder batch processing by selecting a target folder. Save the final fused image. The fusion operation utilizes a weighted adaptive Poisson fusion model. This method can fuse any defect into any region of the target image. It incorporates functions such as -30 to 30 degree rotation and mirroring of the defect (mask region), and supports batch generation of defect-fused new images from single images or folders. Large numbers of fused images can be used for data augmentation. Defect locations can be fixed or randomly generated within a selection box, resulting in more realistic and reliable fused images. These fused images can be used to train defect detection models.

[0098] The image fusion device provided by an embodiment of the present invention is introduced below. The image fusion device described below and the image fusion method described above can be referred to in correspondence with each other.

[0099] Please refer to Figure 7 , Figure 7 A schematic structural diagram of an image fusion device provided in an embodiment of the present invention may include:

[0100] The mask region selection module 100 is configured to select a region based on the source image to obtain a mask region; the mask region includes a defect region;

[0101] A target region selection module 200 is configured to select a region based on a target image to obtain a target region;

[0102] The image fusion module 300 is configured to fuse the mask region with the target region of the target image using a weighted adaptive Poisson fusion model to obtain a fused image.

[0103] Based on the above embodiment, the image fusion module 300 may include:

[0104] A weighted adaptive Poisson fusion model construction unit is used to perform a dynamic weight adjustment mechanism on the boundary and mask areas based on the Poisson model to obtain the weighted adaptive Poisson fusion model;

[0105] The Poisson model is:

[0106] ;

[0107] The weighted adaptive Poisson fusion model is:

[0108] ;

[0109] in, represents the Laplacian operator of the fused image I; div represents the divergence operation; is the gradient of the source image; is the mask area; is the boundary of the mask area; is the pixel value of the fused image on the boundary; is the pixel value of the boundary on the target image; is the dynamic adaptive weight parameter within the mask area; is the dynamic adaptive weight parameter on the boundary; is the gradient of the target image; The pixel value of the boundary on the source image.

[0110] Based on the above embodiment, the dynamic adaptive weight parameter in the mask area for:

[0111] ;

[0112] Where k is the slope control factor and T is the gradient amplitude threshold parameter.

[0113] Based on the above embodiment, the dynamic adaptive weight parameter on the boundary for:

[0114] ;

[0115] Where R is the width of the transition zone; σ is the smoothing coefficient; is the distance from the internal pixel to the boundary of the target area.

[0116] Based on the above embodiment, the image fusion device may further include:

[0117] An operation mode acquisition module is used to acquire an operation mode for image generation; the operation modes include a single-image generation mode and a batch generation mode; the single-image generation mode includes a single-image multi-position single-image generation mode and a single-image single-position single-image generation mode; the batch generation mode includes a single-image multi-position batch generation mode and a multi-image automatic batch generation mode; the single image is one target image, and the multi-image is a plurality of different target images;

[0118] Accordingly, the image fusion module 300 may include:

[0119] The first image fusion unit is configured to fuse the mask area with the target area of ​​the target image using the weighted adaptive Poisson fusion model according to the operation mode to obtain a fused image.

[0120] Based on the above embodiment, the first image fusion unit may include:

[0121] A target region selection subunit is configured to randomly select an image from a folder for region selection to obtain the target region when the operation mode is a multi-image automatic batch generation mode;

[0122] The batch generation subunit is used to use the weighted adaptive Poisson fusion model to fuse the mask area on the target area of ​​all images in the folder to obtain multiple fused images in batches.

[0123] Based on the above embodiment, the image fusion device may further include:

[0124] A processing method acquisition module, configured to acquire a processing method for the mask area; the processing method includes at least one of random rotation and random mirror transformation;

[0125] Accordingly, the image fusion module 300 may include:

[0126] The second image fusion unit is configured to fuse the mask area with the target area of ​​the target image using the weighted adaptive Poisson fusion model according to the processing method to obtain a fused image.

[0127] It should be noted that the order of the modules and units in the above-mentioned image fusion device can be changed without affecting the logic.

[0128] The image fusion device provided by an embodiment of the present invention comprises a mask region selection module 100 for selecting a region based on a source image to obtain a mask region; the mask region includes a defect region; a target region selection module 200 for selecting a region based on a target image to obtain a target region; and an image fusion module 300 for fusing the mask region with the target region of the target image using a weighted adaptive Poisson fusion model to obtain a fused image. The present invention fuses the mask region of the source image and the target region of the target image based on a weighted adaptive Poisson fusion model, seamlessly fusing the mask region into the target region of the target image while preserving the characteristics of the mask region in the source image. This fusion method eliminates the hard boundary effect of traditional methods while better preserving edge directional features, significantly improving the fusion effect of images with clear structures. This device can be quickly applied in industrial scenarios and can also generate fused images in batches, greatly improving fusion efficiency and accuracy. Furthermore, the operational threshold is low, and no specialized training is required for use.

[0129] The image fusion device provided by an embodiment of the present invention is introduced below. The image fusion device described below and the image fusion method described above can be referred to in correspondence with each other.

[0130] Please refer to Figure 8 , Figure 8 A schematic structural diagram of an image fusion device provided in an embodiment of the present invention may include:

[0131] Memory 10, for storing computer programs;

[0132] The processor 20 is configured to execute a computer program to implement the above-mentioned image fusion method.

[0133] The memory 10 , the processor 20 , and the communication interface 31 all communicate with each other via the communication bus 32 .

[0134] In the embodiment of the present invention, the memory 10 is used to store one or more programs. The program may include program code, and the program code includes computer operation instructions. In the embodiment of the present invention, the memory 10 may store programs for implementing the following functions:

[0135] Performing region selection based on the source image to obtain a mask region; the mask region includes the defect region;

[0136] Perform region selection based on the target image to obtain the target region;

[0137] The weighted adaptive Poisson fusion model is used to fuse the mask area with the target area of ​​the target image to obtain a fused image.

[0138] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function, etc.; the data storage area may store data created during use.

[0139] In addition, the memory 10 may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset or an extended set thereof. The operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.

[0140] The processor 20 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic device. The processor 20 may be a microprocessor or any conventional processor. The processor 20 may call a program stored in the memory 10 .

[0141] The communication interface 31 may be an interface of a communication module, used for connecting to other devices or systems.

[0142] Of course, it needs to be explained that Figure 8 The structure shown does not constitute a limitation on the image fusion device in the embodiment of the present invention. In actual applications, the image fusion device may include Figure 8 More or fewer components than shown, or combinations of certain components.

[0143] The following introduces a computer-readable storage medium provided by an embodiment of the present invention. The computer-readable storage medium described below and the image fusion method described above can be referenced to each other.

[0144] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above-mentioned image fusion method are implemented.

[0145] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program codes.

[0146] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0147] Professionals may 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 above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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 the present invention.

[0148] Finally, it should be noted that, in this document, relationships such as first and second, etc., are used solely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0149] The above is a detailed introduction to the image fusion method, device, equipment and computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. An image fusion method, characterized in that: include: Perform region selection based on the source image to obtain the mask region; The mask region includes a defect region; Perform region selection based on the target image to obtain the target region; The mask region is fused with the target region of the target image using a weighted adaptive Poisson fusion model to obtain a fused image.

2. The image fusion method according to claim 1, characterized in that: The construction process of the weighted adaptive Poisson fusion model includes: Based on the Poisson model, a dynamic weight adjustment mechanism is performed on the boundary and mask areas respectively to obtain the weighted adaptive Poisson fusion model; The Poisson model is: ; The weighted adaptive Poisson fusion model is: ; in, represents the Laplacian operator of the fused image I; div represents the divergence operation; is the gradient of the source image; is the mask area; is the boundary of the mask area; is the pixel value of the fused image on the boundary; is the pixel value of the boundary on the target image; is the dynamic adaptive weight parameter within the mask area; is the dynamic adaptive weight parameter on the boundary; is the gradient of the target image; The pixel value of the boundary on the source image.

3. The image fusion method according to claim 2, characterized in that: Dynamically adaptive weight parameters within the mask area for: ; Where k is the slope control factor and T is the gradient amplitude threshold parameter.

4. The image fusion method according to claim 2, characterized in that: Dynamically adaptive weight parameters on boundaries for: ; Where R is the width of the transition zone; σ is the smoothing coefficient; is the distance from the internal pixel to the boundary of the target area.

5. The image fusion method according to claim 1, characterized in that: Before fusing the mask region with the target region of the target image using the weighted adaptive Poisson fusion model to obtain a fused image, the method further includes: Acquire an operation mode for image generation; the operation modes include a single-image generation mode and a batch generation mode; the single-image generation mode includes a single-image, multi-position, single-image generation mode and a single-image, single-position, single-image generation mode; the batch generation mode includes a single-image, multi-position, batch generation mode and a multi-image automatic batch generation mode; the single image is one target image, and the multi-image is multiple different target images; Accordingly, the mask area is fused with the target area of ​​the target image using a weighted adaptive Poisson fusion model to obtain a fused image, including: According to the operation mode, the weighted adaptive Poisson fusion model is used to fuse the mask area with the target area of ​​the target image to obtain a fused image.

6. The image fusion method according to claim 5, characterized in that: According to the operation mode, the weighted adaptive Poisson fusion model is used to fuse the mask area with the target area of ​​the target image to obtain a fused image, including: When the operation mode is a multi-image automatic batch generation mode, randomly selecting an image from a folder for region selection to obtain the target region; The weighted adaptive Poisson fusion model is used to fuse the mask area on the target area of ​​all images in the folder to obtain multiple fused images in batches.

7. The image fusion method according to claim 1, characterized in that: Before fusing the mask region with the target region of the target image using the weighted adaptive Poisson fusion model to obtain a fused image, the method further includes: Obtaining a processing method for the mask area; the processing method includes at least one of random rotation and random mirror transformation; Accordingly, the mask area is fused with the target area of ​​the target image using a weighted adaptive Poisson fusion model to obtain a fused image, including: According to the processing method, the weighted adaptive Poisson fusion model is used to fuse the mask area with the target area of ​​the target image to obtain a fused image.

8. An image fusion device, characterized in that: include: A mask region selection module is used to select a region based on a source image to obtain a mask region; The mask region includes a defect region; A target region selection module is used to select a region based on a target image to obtain a target region; The image fusion module is used to fuse the mask area with the target area of ​​the target image by using a weighted adaptive Poisson fusion model to obtain a fused image.

9. An image fusion device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the image fusion method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the image fusion method according to any one of claims 1 to 7 is implemented.