The invention relates to the technical field of
image processing, and discloses a method and
system for switching backgrounds in batches to form a new
image based on a
convolutional neural network, and the method comprises the steps: carrying out the analysis of a cartoon image, obtaining a foreground segmentation
mask and a foreground material feature
tensor, carrying out the analysis of a target
background image, and obtaining a background illumination
feature vector; dynamic light and shadow interaction between a cartoon foreground and a new background is simulated by constructing a double-medium light
interaction field, fine fusion of an
edge region is realized in combination with an edge
transmission matrix, the problem of visual splitting caused by light and shadow interaction deficiency in background switching of a traditional
convolutional neural network is solved, and meanwhile, through a light and shadow residual
image correction mechanism, the dynamic light and shadow interaction between the cartoon foreground and the new background is corrected. The illumination consistency is further optimized, the fusion matching degree of the cartoon image and various real or virtual scenes is remarkably improved, the diversified marketing scenes can be efficiently adapted through a
batch processing mode, and the batch replacement requirement is met while the visual naturalness is guaranteed.