Method, device and equipment for picture restoration based on fusion algorithm and medium

Through the image repair method based on the fusion algorithm, the product images generated by AI are processed, and the problems of multiple edge compensation and poor fusion degree are solved, fast and efficient image repair is achieved, and the effect and efficiency of image processing are improved.

CN120070193APending Publication Date: 2025-05-30ZIXUN TECHNOLOGY (FUJIAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510108240.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, AI-generated product images often have problems such as excessive edge repair or products cannot be well integrated into the background, resulting in images being unusable or taking a lot of time for manual repair.

Method used

The image repair method based on the fusion algorithm is adopted, and the products are removed through the elimination algorithm, the product body is obtained by cutting the image, the image is synthesized to generate the product bonding map, and the edge mask is processed through the expansion corrosion algorithm and the feathering algorithm. Finally, two fusions are performed through the Poisson fusion algorithm to obtain the final result map.

Benefits of technology

It effectively solves the problems of poor fusion degree of edges between the product body and the product body and multiple edges, quickly repairs the generated image, and significantly improves the effect and efficiency of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070193A_ABST
    Figure CN120070193A_ABST
Patent Text Reader

Abstract

The invention provides an image restoration method and device based on a fusion algorithm, equipment and a medium, and the method comprises the steps: obtaining a background image with a commodity removed through an elimination algorithm; carrying out matting on the original commodity graph to obtain a commodity main body graph; synthesizing the commodity main body image and the background image to obtain a commodity fitting image; obtaining a commodity main body mask graph through the commodity main body graph; carrying out negation operation and edge beautification on the commodity main body mask graph, and carrying out negation operation again to obtain a first edge fusion mask graph; after the commodity main body mask graph is processed through an expansion corrosion algorithm, edge beautification is carried out, and a second edge fusion mask graph is obtained; inputting the background image, the commodity fitting image and the second edge fusion mask image into a fusion algorithm for fusion to obtain a fusion image; and inputting the commodity fitting image, the fusion image and the first edge fusion mask image into a fusion algorithm for fusion to obtain a result image, so that the problem of excessive edge complementation can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image restoration, and particularly relates to a method, device, equipment and medium for image restoration based on a fusion algorithm. Background Art

[0002] In the prior art in the e-commerce industry, the stablediffusion model is often used to generate product pictures with the required background for new products in its store; however, the product pictures generated in this way often have the phenomenon of multiple supplementary objects appearing at the edge of the product main body, or the product cannot be well integrated into the background, which directly results in the unusability of the picture; or it needs to be manually repaired by a graphic designer. This method is restricted by the technology of the graphic designer and requires a lot of time. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a method, device, equipment and medium for image restoration based on a fusion algorithm, which can effectively handle the problem of multiple supplements at the edge and achieve better integration of the product edge into the generated background.

[0004] In a first aspect, the present invention provides a method for image restoration based on a fusion algorithm, which is used to process generated images generated by AI and includes the following steps:

[0005] Step 1, eliminate the product in the generated image through an elimination algorithm to obtain a background image without the product;

[0006] Step 2, perform matte extraction on the original product image to obtain a product main body image;

[0007] Step 3, perform image synthesis on the product main body image and the background image to obtain a product fitting image;

[0008] Step 4, extract the alpha channel of the product main body image to obtain a product main body mask image;

[0009] Step 5, perform an inversion operation on the product main body mask image, then perform edge beautification, and perform an inversion operation again to obtain a first edge fusion mask image; after processing the product main body mask image through the dilation and erosion algorithm, perform edge beautification to obtain a second edge fusion mask image;

[0010] Step 6, input the background image, the product fitting image and the second edge fusion mask image into the fusion algorithm for fusion to obtain a fused image;

[0011] Step 7, input the product fitting image, the fused image and the first edge fusion mask image into the fusion algorithm for fusion to obtain a result image.

[0012] In a second aspect, the present invention provides a device for image restoration based on a fusion algorithm, which is used to process generated images generated by AI, and includes:

[0013] A background removal module, which eliminates the commodity in the generated image through an elimination algorithm to obtain a background image with the commodity removed;

[0014] A matting module, which performs matting on the original commodity image to obtain a commodity main body image;

[0015] A synthesis module, which performs image synthesis on the commodity main body image and the background image to obtain a commodity fitting image;

[0016] A main body mask extraction module, which extracts the alpha channel of the commodity main body image to obtain a commodity main body mask image;

[0017] An edge mask extraction module, which performs an inversion operation on the commodity main body mask image, then performs edge beautification, and performs an inversion operation again to obtain a first edge fusion mask image; after the commodity main body mask image is processed by the dilation and erosion algorithm, edge beautification is performed again to obtain a second edge fusion mask image;

[0018] A fusion module, which inputs the background image, the commodity fitting image, and the second edge fusion mask image into the fusion algorithm for fusion to obtain a fused image;

[0019] A restoration module, which inputs the commodity fitting image, the fused image, and the first edge fusion mask image into the fusion algorithm for fusion to obtain a result image.

[0020] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method described in the first aspect is implemented.

[0021] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0022] One or more technical solutions provided by the present invention have at least the following technical effects or advantages:

[0023] The present invention effectively solves the problems of poor fusion degree between the generated background and the edge of the commodity main body and excessive edge filling through two fusions; quickly restores the generated image, greatly improving the effect and efficiency of image processing.

[0024] The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the content of the specification. And in order to make the above and other objects, features and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention are given below. Brief Description of the Drawings

[0025] The present invention will be further described below with reference to the accompanying drawings in conjunction with embodiments.

[0026] Figure 1 It is a flow chart of the method in the first embodiment of the present invention;

[0027] Figure 2 It is a structural schematic diagram of the device in the second embodiment of the present invention. Detailed Embodiments

[0028] The overall idea of the technical solution in the embodiments of the present application is as follows:

[0029] Poisson fusion, also known as Poisson Blending, is an image fusion algorithm. The purpose is to put a part of two different images together and fuse them to obtain a new image. The more natural the result, the better the fusion effect;

[0030] The LaMa elimination algorithm, also known as the lama inpaint algorithm, is an image elimination algorithm based on deep learning and is often used to eliminate the commodity main body, text, watermark, etc. in the commodity picture.

[0031] The feathering algorithm refers to an image processing algorithm that can make the image edge change from clear to hazy through a progressive blurring effect, so as to achieve the purpose of beautifying the edge of the commodity image.

[0032] The specific implementation is as follows:

[0033] (1) After eliminating the redundant commodities through the LaMa elimination algorithm, a background image without commodities is obtained and named as the background image;

[0034] (2) After the original commodity image is cut out by Photoshop or the deep learning cut-out algorithm, a transparent commodity image with only the commodity main body is obtained;

[0035] (3) The transparent commodity image and the background image are synthesized to obtain a commodity fitting image;

[0036] (4) The alpha channel of the transparent commodity image is extracted to obtain a black-and-white mask image named mask1;

[0037] (5) The black-and-white transparent image mask1 is inverted, then the edge is beautified using the feathering algorithm, and then inverted again to obtain an edge fusion image named mask2;

[0038] (6) After performing the dilation and erosion algorithm on the black and white transparent mask1 and then the feathering algorithm, a fused mask is obtained and named mask3;

[0039] (7) Use the background image as the background for fusion, the product image fitting image as the foreground, and the fused mask3 as the mask area, and use the Poisson algorithm to fuse to obtain a fused image;

[0040] (8) Use the product fitting image as the foreground, the fused image as the background, and mask2 as the mask for the fusion area, and after fusing using the Poisson algorithm, obtain the final result image.

[0041] Example 1

[0042] As Figure 1 shown, this example provides a method for image restoration based on a fusion algorithm for processing generated images generated by AI, including the following steps:

[0043] Step 1: Eliminate the product in the generated image through an elimination algorithm to obtain a background image with the product removed;

[0044] Step 2: Cut out the original product image to obtain a product main body image;

[0045] Step 3: Synthesize the product main body image and the background image to obtain a product fitting image;

[0046] Step 4: Extract the alpha channel of the product main body image to obtain a product main body mask image;

[0047] Step 5: Perform an inversion operation on the product main body mask image, then perform edge beautification, and perform an inversion operation again to obtain a first edge fusion mask image; After processing the product main body mask image through the dilation and erosion algorithm and then performing edge beautification, obtain a second edge fusion mask image;

[0048] Step 6: Input the background image, the product fitting image, and the second edge fusion mask image into the fusion algorithm for fusion to obtain a fused image;

[0049] Step 7: Input the product fitting image, the fused image, and the first edge fusion mask image into the fusion algorithm for fusion to obtain a result image.

[0050] In this example, preferably, step 1 is specifically: using the LaMa elimination algorithm to eliminate the redundant product in the generated image to obtain a background image with the product removed.

[0051] In this embodiment, preferably, step 2 is specifically as follows: Judge the pixels of the original product image. If the pixels of the original product image are less than 2000×2000, directly perform a matting operation through the Visual Intelligence Open Platform to obtain the required product main image. If the pixels of the original product image are greater than or equal to 2000×2000, use Imgproc.resize in OpenCV with the Imgproc.INTER_LANCZ0S4 algorithm to scale the original product image proportionally to obtain a scaled image. Perform a matting operation on the scaled image through the Visual Intelligence Open Platform to obtain a first mask image. Use Imgproc.resize in OpenCV with the Imgproc.INTER_LANCZ0S4 algorithm to restore the first mask image to the original size of the second mask image proportionally. Read the alpha channel of each pixel point in the original product image to obtain a first matrix, read the alpha channel of each pixel point in the second mask image to obtain a second matrix, and call Core.min to merge the first matrix and the second matrix to obtain a third matrix. Replace the alpha channel in the original product image with the third matrix to obtain the required product main image;

[0052] Due to the matting size limit of the Alibaba Cloud Visual Intelligence Open Platform, when the longest side exceeds 2000 pixels, it is necessary to perform proportional scaling. Call Imgproc.resize to use the Imgproc.INTER_LANCZOS4 algorithm for image scaling;

[0053] Call Imgproc.resize to use the Imgproc.INTER_LANCZOS4 algorithm for image scaling. This algorithm can reduce the influence of artifacts while maintaining the edge sharpness.

[0054] Obtain the matting result according to the black and white image + original image:

[0055] a. Take out the alpha channel of the original image. Call Core.min, which will take the minimum value of the transparency channels of the mask and the original image, ensuring that the original information of the transparency channel is retained. Through this step of processing, the lines of the obtained matting can be made more perfect;

[0056] b. Remove the alpha channel of the original image and add the black and white image as the new alpha channel for layer merging;

[0057] c. Set the color value of the transparent area to black. This step is to reduce the size of the matting result image and save storage costs.

[0058] The core code is as follows:

[0059] / / Create a fully transparent matrix with the same size as the original image for comparison;

[0060] Mat compareAlpha = new Mat(outImg.size(), CvType.CV_8UC1, Scalar.all(0.0));

[0061] / / Used to save the comparison result;

[0062] Mat compareResult = new Mat();

[0063] / / Compare the alpha channel of the original image with alpha. The positions with value 0 in the obtained mask are the transparent positions in the original image;

[0064] Core.compare(outPlanes.get(3), compareAlpha, compareResult, Core.CMP_EQ);

[0065] / / Create a completely black matrix with the same size as the original image;

[0066] Mat black = new Mat(outImg.size(), outImg.type(), Scalar.all(0));

[0067] / / Copy the black color in black to the corresponding positions in outImg according to the mask;

[0068] Core.bitwise_and(black, outImg, outImg, compareResult);

[0069] Through the above method, a ready-made matting software can be directly used for matting, and it is ensured that the quality of the picture will not decline.

[0070] In this embodiment, preferably, the specific step 5 is as follows: perform an inversion operation on the commodity main body mask image, then use a feathering algorithm to beautify the edge, and then perform an inversion operation again to obtain a first edge fusion mask image; after processing the commodity main body mask image through a dilation and erosion algorithm, then use a feathering algorithm to beautify the edge to obtain a second edge fusion mask image.

[0071] Based on the same inventive concept, the present application also provides an apparatus corresponding to the method in Embodiment 1, as detailed in Embodiment 2.

[0072] Embodiment 2

[0073] As Figure 2As shown, in this embodiment, a device for image restoration based on a fusion algorithm is provided, which is characterized in that it is used to process the generated image generated by AI and includes:

[0074] A background removal module that eliminates the product in the generated image through an elimination algorithm to obtain a background image with the product removed;

[0075] Perform matte extraction on the original product image to obtain a product main body image;

[0076] A synthesis module that synthesizes the product main body image and the background image to obtain a product fitting image;

[0077] A main body mask extraction module that extracts the alpha channel of the product main body image to obtain a product main body mask image;

[0078] An edge mask extraction module that performs an inversion operation on the product main body mask image, then performs edge beautification, and performs an inversion operation again to obtain a first edge fusion mask image; after processing the product main body mask image through a dilation and erosion algorithm, perform edge beautification again to obtain a second edge fusion mask image;

[0079] A fusion module that inputs the background image, the product fitting image, and the second edge fusion mask image into a fusion algorithm for fusion to obtain a fused image;

[0080] A restoration module that inputs the product fitting image, the fused image, and the first edge fusion mask image into a fusion algorithm for fusion to obtain a result image.

[0081] In this embodiment, preferably, the background removal module is specifically: eliminating the redundant product in the generated image through the LaMa elimination algorithm to obtain a background image with the product removed.

[0082] In this embodiment, preferably, the matting module specifically operates as follows: Determine the pixels of the original product image. If the pixels of the original product image are less than 2000×2000, directly perform matting operations through the Visual Intelligence Open Platform to obtain the required product main image. If the pixels of the original product image are greater than or equal to 2000×2000, use the Imgproc.resize in OpenCV with the Imgproc.INTER_LANCZ0S4 algorithm to scale the original product image proportionally to obtain a scaled image. Perform matting operations on the scaled image through the Visual Intelligence Open Platform to obtain a first mask image. Use the Imgproc.resize in OpenCV with the Imgproc.INTER_LANCZ0S4 algorithm to restore the first mask image to the original size to obtain a second mask image of the original size. Read the alpha channel of each pixel point in the original product image to obtain a first matrix, read the alpha channel of each pixel point in the second mask image to obtain a second matrix, and call Core.min to merge the first matrix and the second matrix to obtain a third matrix. Replace the alpha channel in the original product image with the third matrix to obtain the required product main image;

[0083] Due to the matting size limit of the Alibaba Cloud Visual Intelligence Open Platform, when the longest side exceeds 2000 pixels, proportional scaling is required. Call Imgproc.resize and use the Imgproc.INTER_LANCZOS4 algorithm to perform image proportional scaling;

[0084] Call Imgproc.resize and use the Imgproc.INTER_LANCZOS4 algorithm to perform image proportional scaling. This algorithm can reduce the impact of artifacts while maintaining edge clarity.

[0085] Obtain the matting result based on the black and white image + original image:

[0086] a. Take out the alpha channel of the original image. Call Core.min, which will take the minimum value of the transparency channels of the mask and the original image, ensuring that the original information of the transparency channel is retained. Through this step of processing, the lines of the obtained matting can be made more perfect;

[0087] b. Remove the alpha channel of the original image and add the black and white image as the new alpha channel for layer merging;

[0088] c. Set the color value of the transparent area to black. This step is to reduce the size of the matting result image and save storage costs.

[0089] The core code is as follows:

[0090] / / Create a fully transparent matrix with the same size as the original image for comparison;

[0091] Mat compareAlpha = new Mat(outImg.size(), CvType.CV_8UC1, Scalar.all(0.0));

[0092] / / Used to save the comparison result;

[0093] Mat compareResult = new Mat();

[0094] / / Compare the alpha channel of the original image with alpha. The positions with value 0 in the obtained mask are the transparent positions in the original image;

[0095] Core.compare(outPlanes.get(3), compareAlpha, compareResult, Core.CMP_EQ);

[0096] / / Create a completely black matrix with the same size as the original image;

[0097] Mat black = new Mat(outImg.size(), outImg.type(), Scalar.all(0));

[0098] / / Copy the black color in black to the corresponding positions in outImg according to the mask;

[0099] Core.bitwise_and(black, outImg, outImg, compareResult);

[0100] Through the above method, ready-made matting software can be directly used for matting, and it is ensured that the quality of the picture will not decline.

[0101] In this embodiment, preferably, the edge extraction mask module is specifically: perform an inversion operation on the commodity main body mask image, then use a feathering algorithm for edge beautification, and then perform an inversion operation again to obtain a first edge fusion mask image; after processing the commodity main body mask image through the dilation and erosion algorithm, and then perform edge beautification through the feathering algorithm to obtain a second edge fusion mask image.

[0102] Since the device introduced in the second embodiment of the present invention is the device used to implement the method of the first embodiment of the present invention, based on the method introduced in the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the device, so it will not be elaborated here. Any device used in the method of the first embodiment of the present invention belongs to the scope protected by the present invention.

[0103] Based on the same inventive concept, this application provides an embodiment of an electronic device corresponding to Embodiment 1. For details, see Embodiment 3.

[0104] Embodiment 3

[0105] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, any implementation manner in Embodiment 1 can be realized.

[0106] Since the electronic device introduced in this embodiment is the device used to implement the method in Embodiment 1 of this application, based on the method introduced in Embodiment 1 of this application, those skilled in the art can understand the specific implementation manner of the electronic device in this embodiment and its various variations. Therefore, the specific implementation of how this electronic device realizes the method in the embodiments of this application will not be introduced in detail here. As long as the device used by those skilled in the art to implement the method in the embodiments of this application belongs to the scope protected by this application.

[0107] Based on the same inventive concept, this application provides a storage medium corresponding to Embodiment 1. For details, see Embodiment 4.

[0108] Embodiment 4

[0109] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any implementation manner in Embodiment 1 can be realized.

[0110] The technical solutions provided in the embodiments of this application at least have the following technical effects or advantages:

[0111] The present invention effectively solves the problems of poor fusion degree between the generated background and the edge of the commodity main body and excessive edge filling through two fusions; quickly repairs the generated image, greatly improving the effect and efficiency of image processing. And by using the Visual Intelligence Open Platform to perform image matting after image reduction to obtain a mask image, and then restoring it to the original scale and synthesizing it with the original image, a high-quality image matting effect can be achieved without sacrificing the image quality.

[0112] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0113] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate means for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or means for implementing the functions specified in one or more of the blocks.

[0114] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or means for implementing the functions specified in one or more of the blocks.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operating steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or means for implementing the functions specified in one or more of the blocks.

[0116] Although the specific embodiments of the present invention have been described above, those skilled in the art of this technology should understand that the specific embodiments we described are illustrative rather than used to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered by the scope protected by the claims of the present invention.

Claims

1. A method for image restoration based on a fusion algorithm, characterized in that: The process for processing the generated graph generated by AI includes the following steps: Step 1: Eliminate the products in the generated image through an elimination algorithm to obtain a background image without the products; Step 2: Cut out the original product image to obtain the main product image; Step 3: synthesize the product main image and the background image to obtain a product fitting image; Step 4: Extract the alpha channel of the product main image to obtain the product main mask image; Step 5: The product main body mask image is inverted, and then edge beautification is performed, and the inversion operation is performed again to obtain a first edge fusion mask image; the product main body mask image is processed by the expansion and corrosion algorithm, and then edge beautification is performed to obtain a second edge fusion mask image; Step 6: Input the background image, the product fitting image, and the second edge fusion mask image into the fusion algorithm for fusion to obtain a fusion image; Step 7: Input the product fitting image, the fusion image, and the first edge fusion mask image into the fusion algorithm for fusion to obtain a result image.

2. The method for image restoration based on a fusion algorithm according to claim 1, characterized in that: The step 1 specifically includes: eliminating the overfilled products in the generated image through the LaMa elimination algorithm to obtain a background image without the products.

3. The method for image restoration based on a fusion algorithm according to claim 1, characterized in that: The step 2 is specifically as follows: judging the pixels of the original product image, if the pixels of the original product image are less than 2000×2000, directly performing a cutout operation through the visual intelligence open platform to obtain the required product main body image; if the pixels of the original product image are greater than or equal to 2000×2000, using Imgproc.resize in OpenCV and using the Imgproc.INTER_LANCZ0S4 algorithm to scale the original product image in proportion to obtain a scaled image; performing a cutout operation on the scaled image through the visual intelligence open platform to obtain a first mask image; restoring the first mask image to a second mask image of the original size in proportion through Imgproc.resize in OpenCV and using the Imgproc.INTER_LANCZ0S4 algorithm; reading out the transparent channel of each pixel in the original product image to obtain a first matrix, reading out the transparent channel of each pixel in the second mask image to obtain a second matrix, calling Core.min to merge the first matrix with the second matrix to obtain a third matrix; The transparent channel in the original product image is replaced by the third matrix to obtain the desired product main image.

4. The method for image restoration based on a fusion algorithm according to claim 1, characterized in that: The step 5 is specifically as follows: the product main body mask image is inverted, and then the edge is beautified by the feathering algorithm, and then the inversion operation is performed again to obtain a first edge fusion mask image; the product main body mask image is processed by the expansion and corrosion algorithm, and then the edge is beautified by the feathering algorithm to obtain a second edge fusion mask image.

5. A device for image restoration based on a fusion algorithm, characterized in that: Used to process AI-generated generative graphs, including: The background removal module uses an elimination algorithm to remove the products from the generated image and obtain a background image without the products. The cutout module cuts out the original product image to obtain the main product image; A synthesis module synthesizes the main image of the product and the background image to obtain a product fitting image; Extract the main body mask module, extract the alpha channel of the product main body image to obtain the product main body mask image; Extract the edge mask module, invert the product main body mask map, then perform edge beautification, and invert it again to obtain the first edge fusion mask map; process the product main body mask map through the expansion and corrosion algorithm, and then perform edge beautification to obtain the second edge fusion mask map; The fusion module inputs the background image, the product fitting image and the second edge fusion mask image into the fusion algorithm for fusion to obtain a fusion image; The repair module inputs the product fitting image, the fusion image and the first edge fusion mask image into the fusion algorithm for fusion to obtain the result image.

6. The device for image restoration based on fusion algorithm according to claim 5, characterized in that: The background removal module specifically comprises: eliminating the overfilled commodities in the generated image through the LaMa elimination algorithm to obtain a background image without the commodities.

7. The device for image restoration based on fusion algorithm according to claim 5, characterized in that: The cutout module is specifically as follows: the pixels of the original product image are judged. If the pixels of the original product image are less than 2000×2000, the cutout operation is directly performed through the visual intelligence open platform to obtain the required product main body image; if the pixels of the original product image are greater than or equal to 2000×2000, the original product image is scaled proportionally using the Imgproc.resize in OpenCV and the Imgproc.INTER_LANCZ0S4 algorithm to obtain a scaled image; the scaled image is cutout through the visual intelligence open platform to obtain a first mask image; the first mask image is proportionally restored to a second mask image of the original size through the Imgproc.resize in OpenCV and the Imgproc.INTER_LANCZ0S4 algorithm; the transparent channel of each pixel in the original product image is read out to obtain a first matrix, the transparent channel of each pixel in the second mask image is read out to obtain a second matrix, and Core.min is called to merge the first matrix with the second matrix to obtain a third matrix; The transparent channel in the original product image is replaced by the third matrix to obtain the desired product main image.

8. The device for image restoration based on fusion algorithm according to claim 5, characterized in that: The edge mask extraction module is specifically as follows: the product main body mask image is inverted, and then the edge is beautified by the feathering algorithm, and then the inversion operation is performed again to obtain a first edge fusion mask image; the product main body mask image is processed by the expansion and corrosion algorithm, and then the edge is beautified by the feathering algorithm to obtain a second edge fusion mask image.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.