| With the continuous development of deep learning,image synthesis has been widely studied and plays an important role in data enhancement,image restoration,artistic creation,etc.Shadow generation aims to add appropriate shadows to foreground objects during image synthesis,supplement lighting information to images to maintain appearance consistency,and make composite images more three-dimensional and realistic.The shadow generation algorithm is mainly based on two methods of inverse rendering and image conversion.The method based on inverse rendering needs to obtain the attribute information related to the real scene,such as:lighting,material,geometric position,etc.Then render according to this information to obtain the shadow of the object,but obtaining this information requires high time and calculation costs.And inaccurate information acquisition will have a great impact on the rendering results.Image transformation-based methods utilize generative adversarial networks to achieve end-to-end shadow generation,reduce the dependence on additional information,and exhibit excellent performance.However,there are still some shortcomings in the existing methods,such as the result is not stable enough in the case of multi-object background,and the generated shadows lack detailed information.This thesis improves on the basis of generative confrontation network and proposes new shadow generation methods.The main contributions of this thesis are as follows:(1)MultiShadow is a method based on a shadow detection map.By introducing attention mechanism and shadow detection technology,the feature extraction ability of the model is improved and the position information of objects and shadows is fused during the shadow generation process.Thus,the ability of shadow generation method to deal with complex background is enhanced.Obtain the attention map of the objects in the background image and the corresponding shadows through the attention mechanism.And the generator uses the attention map to extract features from the important areas of the image,so that the generated shadows are more realistic.Shadow detection technology can detect the position of objects and shadows in the image,and then use the discriminator to distinguish the detection map.Through adversarial learning,the position information of objects and shadows is fed back to the generator,which promotes the generator to generate shadow composite images whose position information is closer to the real image.Finally,it is verified by experiments that MultiShadow can generate realistic shadows for foreground objects under complex background conditions.(2)On the basis of MultiShadow,this thesis proposes a shadow generation method based on edge information preservation:Edge-ShadowGAN.Edge-ShadowGAN introduces edge detectors and densely connected modules to further improve the generator.The edge detector is used to extract the edge map of objects and shadows in the image.The edge information in the generated image and the real image are kept as consistent as possible through edge loss.So that the generated shadows have more realistic outlines and details such as lightness and darkness.In the coarse shadow generation module,U-Net is optimized with densely connected module to further enhance the performance of the generator.The discriminator introduces a local discriminator,and then distinguishes the image through global information and local information.Finally,the effectiveness of Edge-ShadowGAN is verified through experiments. |