Method, apparatus, device and storage medium for generating special effect diagrams
By acquiring light source information and normal map to generate target lighting map and fusing it with the original image, the problem of lighting effects under natural light not meeting user needs is solved, and the image display content is enriched and personalized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2022-08-26
- Publication Date
- 2026-05-26
AI Technical Summary
When shooting or producing videos under natural light, the lighting effects often fail to meet the personalized needs of users.
By acquiring the current light source information, the normal map of the original image, and the mask map of the target object, a target lighting map is generated and then fused with the original image to generate a special effect image with lighting effects.
It enriches the content displayed in the image and meets users' personalized needs for lighting effects.
Smart Images

Figure CN115358959B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to a method, apparatus, device, and storage medium for generating special effects images. Background Technology
[0002] Currently, taking photos and editing videos on mobile devices have become common functions for users. However, users often find that the lighting effects of videos taken or edited in natural light conditions do not meet their individual needs. Summary of the Invention
[0003] This disclosure provides a method, apparatus, device, and storage medium for generating special effects images, which can generate special effects images with lighting effects and enrich the display content of images.
[0004] In a first aspect, embodiments of this disclosure provide a method for generating special effects images, including:
[0005] Acquire the current light source information, the normal map of the original image, and the mask map of the target object; wherein, the light source information includes the light source color, the light source position, and the light intensity;
[0006] Generate a target illumination map based on the normal map, the target object mask map, and the light source information;
[0007] The target lighting map and the original image are fused together to obtain a target lighting effect map.
[0008] Secondly, this disclosure also provides an apparatus for generating special effects images, including:
[0009] The acquisition module is used to acquire current light source information, the normal map of the original image, and the mask map of the target object; wherein, the light source information includes light source color, light source position, and light intensity;
[0010] The target illumination map generation module is used to generate a target illumination map based on the normal map, the target object mask map, and the light source information;
[0011] The target lighting effect image acquisition module is used to fuse the target lighting image and the original image to obtain the target lighting effect image.
[0012] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0013] One or more processors;
[0014] Storage device for storing one or more programs.
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the special effects image generation method as described in the embodiments of this disclosure.
[0016] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the method for generating special effects images as described in embodiments of this disclosure.
[0017] This disclosure provides a method, apparatus, device, and storage medium for generating special effects images. The method involves acquiring current light source information, a normal map of the original image, and a target object mask. The light source information includes the light source color, position, and intensity. A target lighting map is generated based on the normal map, the target object mask, and the light source information. The target lighting map and the original image are then fused to obtain a target lighting special effects image. This method, which generates a target lighting map based on the normal map, the target object mask, and the light source information, can generate special effects images with lighting effects, enriching the displayed content of the image. Attached Figure Description
[0018] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0019] Figure 1 This is a schematic flowchart of a method for generating special effects images provided in an embodiment of this disclosure;
[0020] Figure 2a This is an example diagram of a target object mask provided in an embodiment of this disclosure;
[0021] Figure 2b This is an example diagram of a second illumination intensity diagram provided in an embodiment of this disclosure;
[0022] Figure 2c This is an example diagram of a light intensity mask provided in an embodiment of this disclosure;
[0023] Figure 3a This is an example diagram of a reverse target object mask provided in an embodiment of this disclosure;
[0024] Figure 3b This is an example diagram of a first backlight intensity diagram provided in an embodiment of this disclosure;
[0025] Figure 3c This is an example of a first blurred mask image provided in an embodiment of this disclosure;
[0026] Figure 3d This is an example diagram of a second blur mask provided in an embodiment of this disclosure;
[0027] Figure 3e This is an example diagram of a fusion mask provided in an embodiment of this disclosure;
[0028] Figure 3f This is an example diagram of a second backlight intensity map provided in an embodiment of this disclosure;
[0029] Figure 3g This is an example diagram of a target backlight intensity map provided in an embodiment of this disclosure;
[0030] Figure 4a This is an example image of a grayscale image provided in an embodiment of this disclosure;
[0031] Figure 4b This is an example diagram of a local object mask provided in an embodiment of this disclosure;
[0032] Figure 4c This is an example image of a smooth grayscale image provided in an embodiment of this disclosure;
[0033] Figure 4d This is an example diagram of a smoothed local object diagram provided in an embodiment of this disclosure;
[0034] Figure 5 This is a schematic diagram of the structure of a special effects image generation device provided in an embodiment of this disclosure;
[0035] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0036] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0037] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0038] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0039] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0040] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0041] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0042] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0043] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0044] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0045] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0046] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0047] Figure 1 This is a flowchart illustrating a method for generating special effects images according to an embodiment of the present disclosure. This embodiment is applicable to the generation of lighting special effects images. The method can be executed by a device for generating special effects images. This device can be implemented in the form of software and / or hardware, or optionally, by an electronic device, such as a mobile terminal, a PC, or a server.
[0048] like Figure 1 As shown, the method includes:
[0049] S110: Obtain the current light source information, the normal map of the original image, and the mask map of the target object.
[0050] The light source information includes the light source color, light source position, and light intensity. The light source can be a virtual light source, and its position can change based on user triggering operations. In this embodiment, the virtual light source can be generated as follows: First, a transformable (rotate, translate, and scale) empty virtual object is generated and placed at the world coordinate origin; then, a transformable light source object is generated and placed at a distance d from the time coordinate origin; finally, the light source object is used as a child object of the empty virtual object, and by acquiring touch screen drag operations, the transformations are mapped to the empty virtual object, thereby achieving the effect of moving the light source object on the sphere. Here, d can be the radius of the sphere, and the light source object is the virtual light source. The light source color and light intensity can be preset, i.e., set by the user.
[0051] The normal map can be an image composed of the normal information of each pixel in the original image. The normal information is represented by a three-dimensional vector, namely the normal vector, and the three components of the normal information are mapped to three color channel values, thus obtaining the normal map. In this embodiment, any normal estimation algorithm can be used to determine the normal information of each pixel in the original image, and the normal map is generated based on the normal information.
[0052] The target object can be any object such as a person, animal, or plant; there is no limitation here. The pixel value of each pixel in the target object mask represents the confidence level that the pixel belongs to the target object. In this embodiment, the target object mask of the original image can be obtained by: identifying the target object in the original image, obtaining the confidence level of each pixel belonging to the target object, and generating a target object mask based on the confidence level. The pixel value of the target object mask is a value between 0 and 1, where "0" indicates that the pixel does not belong to the target object and is displayed as black in the target object mask, and "1" indicates that the pixel belongs to the target object and is displayed as white in the target object mask. For example, Figure 2a This is an example diagram of a target object mask in this embodiment, such as... Figure 2a As shown, the target object is a human figure, the white area is the human figure, and the black area is the background area.
[0053] S120: Generate a target illumination map based on the normal map, the target object mask map, and the light source information.
[0054] In this target illumination map, the color value of each pixel represents the illumination color of that pixel. In this embodiment, the target illumination map consists of three parts: the target object illumination map, the background area illumination map, and the backlighting map.
[0055] In this embodiment, the method for generating the target illumination map based on the normal map, the target object mask map, and the light source information can be as follows: generate the target object illumination map based on the normal map, the light source information, and the target object mask map; generate the background area illumination map based on the light source information and the target object mask map; generate the back illumination map based on the normal map and the target object mask map; and fuse the target object illumination map, the background area illumination map, and the back illumination map to obtain the target illumination map.
[0056] The target object lighting map is generated based on the lighting color of each pixel in the target object. The background region lighting map is generated based on the lighting color of each pixel in the background region. The backlighting map is generated based on the backlighting color of each pixel in the original image.
[0057] Specifically, the process of generating a target object illumination map based on the normal map, light source information, and target object mask can be as follows: First, determine the illumination intensity of each pixel of the target object based on the normal map, light source information, and target object mask. Then, fuse the illumination intensity with the light source color to obtain the illumination color of each pixel of the target object. Finally, generate the target object illumination map based on the illumination colors of each pixel of the target object. The process of generating a background region illumination map based on the light source information and target object mask can be as follows: First, determine the illumination intensity of each pixel of the background region based on the light source information and target object mask. Then, fuse the illumination intensity with the light source color to obtain the illumination color of each pixel of the background region. Finally, generate the background region illumination map based on the illumination colors of each pixel of the background region. The process of generating a backlighting map based on the normal map and target object mask can be as follows: First, determine the backlighting intensity of each pixel of the original image based on the normal map and target object mask. Then, fuse the backlighting intensity with the light source color to obtain the backlighting color of each pixel. Finally, generate the backlighting map based on the backlighting colors. In this embodiment, a target illumination map is generated based on the target object illumination map, the background area illumination map, and the back illumination map. Different illumination maps are generated based on the image area and the illumination direction, resulting in an illumination map with alternating light and dark areas.
[0058] Optionally, the method for generating the target object illumination map based on the normal map, light source information, and target object mask map can be as follows: determine a first illumination intensity map based on the normal map and light source information; fuse the first illumination intensity map and the light source color to obtain an initial illumination map; fuse the initial illumination map with the target object mask map to obtain the target object illumination map.
[0059] In this first illumination intensity map, the pixel value of each pixel represents the illumination intensity of that pixel. Specifically, the method for determining the first illumination intensity map based on the normal map and light source information can be as follows: first, determine the intensity attenuation information of each pixel based on the normal information and light source information in the normal map; adjust the light source intensity based on the intensity attenuation information to obtain the illumination intensity of each pixel; and finally, generate the first illumination intensity map based on the illumination intensity of each pixel. The method for fusing the first illumination intensity map and the light source color can be as follows: multiply the illumination intensity of each pixel in the first illumination intensity map by the light source color to obtain the illumination color of each pixel. The method for fusing the initial illumination map with the target object mask map can be as follows: multiply the illumination color of the initial illumination map by the pixel value of the corresponding pixel in the target object mask map to obtain the target object illumination map. In this embodiment, fusing the initial illumination map with the target object mask map can accurately determine the illumination color of each pixel of the target object.
[0060] Optionally, the method for determining the first illumination intensity map based on the normal map and light source information can be as follows: determine the first angle information between the incident light ray and the pixel based on the normal map and light source information; determine the attenuation information based on the distance between the light source and the pixel in the original image; adjust the illumination intensity based on the first angle information and the attenuation information to obtain the target intensity of the pixel; and generate the first illumination intensity map based on the target intensity of the pixel.
[0061] Specifically, the process of determining the first angle between the incident ray and a pixel based on the normal map and light source information can be as follows: determine the illumination direction vector, extract the normal vector of each pixel in the normal map, then normalize both the illumination direction vector and the normal vector of each pixel, and finally multiply the normalized illumination direction vector and normal vector by a dot product to obtain the first angle information. The illumination direction vector can be a vector pointing from the light source position (represented in world coordinates) to the center position of the target object (converting screen coordinates to world coordinates), or a vector pointing from the light source position to the center position of the target object's face.
[0062] Specifically, determining attenuation information based on the distance between the light source and pixels in the original image can be done as follows: Transform the light source position from world coordinates to screen coordinates, then calculate the distance between the light source position in the screen coordinate system and pixels in the original image. Subtract the ratio of distance to halo radius from 1 to obtain an intermediate result value. Then, set the exponent of the attenuation value to the intermediate result value to obtain the attenuation information. The process of transforming the light source position from world coordinates to screen coordinates can be as follows: First, multiply the light source's world coordinates on the left by the MVP (Model View Projection) transformation matrix to obtain the light source's projected coordinates. Then, perform a linear transformation on the x and y components of the light source's projected coordinates to obtain the light source's screen coordinates.
[0063] Specifically, adjusting the illumination intensity based on the first included angle information and attenuation information can be achieved by multiplying the illumination intensity sequentially by the first included angle information and the attenuation information to obtain the target intensity of each pixel. Generating a first illumination intensity map based on the target intensity of each pixel can be achieved by using the target intensity as the pixel value, thereby obtaining the first illumination intensity map. In this embodiment, adjusting the illumination intensity based on the first included angle information and attenuation information can improve the accuracy of determining the illumination intensity of each pixel.
[0064] In this embodiment, the method for generating a background area illumination map based on light source information and target object mask map can be as follows: obtain the distance between the light source and the pixels in the original image; generate a second illumination intensity map based on the distance and illumination intensity; fuse the second illumination intensity map with the target object mask map to obtain an illumination intensity mask map; and fuse a set color and illumination color based on the illumination intensity mask map to obtain a background area illumination map.
[0065] Specifically, the method for obtaining the distance between the light source and the pixels in the original image can be: transforming the light source position from world coordinates to screen coordinates, and then calculating the distance between the light source position and the pixels in the original image in the screen coordinate system. The method for generating a second illumination map based on the distance and illumination intensity can be: performing an exponential operation on the distance, subtracting the exponential result from 1 to obtain an intermediate result, multiplying the intermediate result by the illumination intensity of the light source to obtain the illumination intensity of each pixel, and then generating a second illumination map based on the illumination intensity of each pixel. For example, Figure 2b This is an example diagram of the second illumination intensity diagram in this embodiment.
[0066] Specifically, the method for fusing the second illumination intensity map with the target object mask map can be as follows: subtract the corresponding pixel value in the target object mask map from the pixel value of each pixel in the second illumination intensity map. If the resulting pixel value is less than 0, the pixel value is set to 0; if the resulting pixel value is greater than 1, the pixel value is set to 1, thus obtaining the illumination intensity mask map. For example, Figure 2c This is an example diagram of the illumination intensity mask in this embodiment, such as... Figure 2c As shown, the illumination intensity mask can be understood as the illumination intensity map of the target object extracted from the second illumination intensity map.
[0067] The set color can be black, with a corresponding color value of (0, 0, 0). Specifically, the method for fusing the set color and the illumination color based on the illumination intensity mask can be as follows: the pixel value of the illumination intensity mask is used as a weighting coefficient for the illumination color, and the result of subtracting the pixel value of the illumination intensity mask from 1 is used as a weighting coefficient for the set color. The set color and the illumination color are then weighted and summed based on the weighting coefficients. Finally, the weighted summed color value is multiplied by the set value to obtain the illumination color of each pixel, thereby obtaining the illumination map of the background area. The set value can be set to 0.5. In this embodiment, the determined background area has a different illumination color than the target object area, resulting in an alternating light and dark effect in the image.
[0068] Optionally, the method for generating the backlighting map based on the normal map and the target object mask map can be as follows: determine a first backlighting intensity map based on the normal map, the target object mask map, and the viewpoint information; reverse the target object mask map to obtain a reverse target object mask map; generate a second backlighting intensity map based on the target object mask map and the reverse target object mask map; fuse the first backlighting intensity map and the second backlighting intensity map to obtain a target backlighting intensity map; and fuse the target backlighting intensity map with the light source color to obtain the backlighting map.
[0069] The viewpoint information can be the viewpoint of the virtual camera corresponding to the current image, which can be represented by a vector representing the viewpoint direction. The method for inverting the target object mask image can be: subtracting the pixel value of each pixel in the target object mask image from 1 to obtain the inverted target object mask image. For example, Figure 3a This is an example diagram of the reverse target object mask in this embodiment, such as... Figure 3a As shown, compared to the target object mask, the human figure area becomes black and the background area becomes white in the reverse target object mask.
[0070] Specifically, the method for determining the first backlight intensity map based on the normal map, the target object mask map, and the viewpoint information can be as follows: determine the second angle information between the normal information and the viewpoint information of each pixel in the normal map; determine the initial backlight intensity of each pixel based on the second angle information; generate an initial backlight intensity map based on the initial backlight intensity; and fuse the initial backlight intensity map with the target object mask map to obtain the first backlight intensity map.
[0071] The process of determining the second included angle information between the normal information and the view information of each pixel in the normal map can be as follows: normalize the normal vector and the view direction vector respectively, multiply the normalized normal vector and the view direction vector by a dot product, and truncate the result between 0 and 1 to obtain the second included angle information. The process of determining the initial backlight intensity of each pixel based on the second included angle information can be as follows: subtract the second included angle information from 1, and perform an exponential operation on the subtraction result to set the control intensity, and determine the exponential operation result as the initial backlight intensity of each pixel. The set control intensity can be a user-defined value. The method of fusing the initial backlight intensity map with the target object mask map can be as follows: multiply the pixel values of the pixels in the initial backlight intensity map with the corresponding pixel values in the target object mask map. For example, Figure 3b This is an example image of the first backlight intensity map in this embodiment. In this embodiment, an intensity map with a contour lighting effect can be generated.
[0072] Optionally, the method for generating the second backlight intensity map based on the target object mask and the reverse target object mask can be as follows: blurring the target object mask and the reverse target object mask respectively to obtain a first blurred mask and a second blurred mask; fusing the second blurred mask and the reverse target object mask to obtain a fused mask; and fusing the fused mask with the first blurred mask to obtain the second backlight intensity map.
[0073] The first blurred mask can be a blurred version of the target object mask, and the second blurred mask can be a blurred version of the inverse target object mask. The blurring can be Gaussian blur. For example, Figure 3c This is an example of the first blurred mask image. Figure 3d This is an example image of the second blurred mask. Specifically, the method for fusing the second blurred mask and the inverted target object mask can be: taking the maximum value between the pixel values of the second blurred mask and the corresponding pixel values of the inverted target object mask, and generating a fused mask based on the maximum pixel value. For example, Figure 3e This is an example diagram of the fused mask in this embodiment. Specifically, the method for fusing the fused mask with the first blurred mask can be: taking the minimum value between the pixel value of the fused mask and the corresponding pixel value of the first blurred mask, and generating a second backlight intensity map based on the minimum pixel value. For example, Figure 3f This is an example diagram of the second backlight intensity map in this embodiment. In this embodiment, the generated second backlight intensity map has the effect of outlining the target object.
[0074] Specifically, the method for fusing the first backlight intensity map and the second backlight intensity map can be: adding the pixel values of the first backlight intensity map and the pixel values of the second backlight intensity map to obtain the target backlight intensity map. For example, Figure 3g This is an example diagram of the target backlight intensity map in this embodiment. The method for fusing the target backlight intensity map and the light source color can be: multiplying the light intensity in the target backlight intensity map by the light source color to obtain the backlight map.
[0075] Optionally, the target lighting map can be obtained by fusing the target object lighting map, the background area lighting map, and the backlighting map by: determining the relative position between the light source and the target object based on the first included angle information; and fusing the target object lighting map, the background area lighting map, and the backlighting map based on the relative position.
[0076] The relative position includes the light source being in front of the target object, behind the target object, and to the side of the target object. The first included angle information is the dot product of the normal vector and the illumination direction vector. The relative position between the light source and the target object can be determined based on the first included angle information as follows: if the first included angle information glare is within the range (t, 1], i.e., t < glare ≤ 1, then the light source is in front of the target object; if the first included angle information is within the range [-1, -t), i.e., -1 ≤ glare < -t, then the light source is behind the target object; if the first included angle information is within the range [-t, t], i.e., -t ≤ glare ≤ t, then the light source is to the side of the target object. Here, t can be a value between 0 and 1, for example, set to 0.1 or 0.2.
[0077] Specifically, the target lighting map can be obtained by fusing the target object lighting map, background area lighting map, and backlighting map based on their relative positions. For example, if the light source is in front of the target object, the target object lighting map and the background area lighting map are fused to obtain the target lighting map; if the light source is behind the target object, the background area lighting map and the backlighting map are fused to obtain the target lighting map; if the light source is to the side of the target object, the target object lighting map and the backlighting map are interpolated and fused to obtain an intermediate lighting map; and the intermediate lighting map is then fused with the background area lighting map to obtain the target lighting map.
[0078] Specifically, the method for fusing the target object lighting map and the background area lighting map can be: adding the pixel values of the target object lighting map and the pixel values of the background area lighting map. Similarly, the method for fusing the background area lighting map and the backlighting map can be: adding the pixel values of the background area lighting map and the pixel values of the backlighting map.
[0079] Specifically, the interpolation fusion method for the target object lighting map and the backlighting map can be as follows: The mapping relationship between [-t, t] and [0, 1] is determined through interpolation operations. Based on this mapping relationship, the target value corresponding to the first included angle information is determined. The result of subtracting the target value from 1 is used as the weighting coefficient of the target object lighting map. The target value is used as the weighting coefficient of the backlighting map. The target object lighting map and the backlighting map are then weighted according to the weighting coefficients to obtain the intermediate lighting map. The fusion method for the intermediate lighting map and the background region lighting map can be as follows: The pixel values of the intermediate lighting map and the pixel values of the background region lighting map are added together. In this embodiment, determining the target lighting map based on the relative position between the light source and the target object can improve the accuracy and realism of the target lighting map.
[0080] S130, merges the target lighting map and the original image to obtain the target lighting effect map.
[0081] Specifically, one way to fuse the target illumination map and the original image is to add the color values of the target illumination map to the color values of the original image.
[0082] Optionally, the following steps may also be included: acquiring a grayscale image and a local object mask image of the original image; fusing the grayscale image and the local object mask image to obtain a local object image; adjusting the light source color according to the normal image, viewpoint information, and light source position to obtain the target lighting color; fusing the set color and the target lighting color based on the local object image to obtain a local object lighting effect image; and fusing the local object lighting image and the target object lighting image to obtain an updated target object lighting image.
[0083] In this context, a local object is an object comprised of a local region of the target object. In this embodiment, assuming the target object is a human figure, the local object is hair.
[0084] One way to obtain the grayscale image of the original image is to perform grayscale processing on the original image to obtain the grayscale image. For example, Figure 4a This is an example image of a grayscale image in this embodiment.
[0085] One method for obtaining a local object mask from the original image is to identify local objects in the original image and obtain a local object mask. For example, Figure 4b This is an example diagram of a local object mask in this embodiment.
[0086] Specifically, the method to fuse a grayscale image and a local object mask to obtain a local object image can be: smoothing the grayscale image to obtain a smoothed grayscale image; and fusing the smoothed grayscale image and the local object mask to obtain a smoothed local object image.
[0087] One method for smoothing a grayscale image is as follows: Determine a first difference between the grayscale value and a first set value; determine a second difference between a second set value and the first set value; calculate the ratio between the first and second differences; truncate this ratio to between 0 and 1; finally, raise the ratio to the power of N to obtain the processed grayscale value; and generate a smoothed grayscale value based on the processed grayscale value. The first set value can be 0, the second set value can be 0.5, and N can be 3. The formula for raising the ratio to the power of N can be expressed as x*x*(a-bx), where a and b are constants, and x is the ratio. For example... Figure 4c This is an example image of the smoothed grayscale image in this embodiment.
[0088] Specifically, fusing the smoothed grayscale image and the local object mask image can be done by multiplying the pixel values of the smoothed grayscale image and the pixel values of the local object mask image. For example, Figure 4dThis is an example image of a smoothed local object image in this embodiment. In this embodiment, smoothing the grayscale image can highlight more details of the local object, thus giving the local object a highlight effect. For the hair in this embodiment, smoothing the grayscale image can obtain more detailed hair strands, thereby achieving a more accurate lighting effect.
[0089] Specifically, the target illumination color can be obtained by adjusting the light source color based on the normal diagram, viewing angle information, and light source position. This can be achieved by: determining the reflected light direction based on the normal diagram and light source position; determining the third angle information between the viewing angle and the reflected light direction; and adjusting the light source color based on the third angle information to obtain the target illumination color.
[0090] The reflected light direction can be understood as the direction of the reflected light rays. The process of determining the reflected light direction based on the normal diagram and the light source position can be as follows: determine the light direction vector based on the light source position and the center position of the target object; perform a linear calculation between the light direction vector and the normal direction vector to obtain the reflected light direction vector. The linear calculation between the light direction vector and the normal direction vector can be performed by: calculating the dot product of the light direction vector and the normal direction vector; multiplying the dot product, a set value, and the normal direction vector; and then subtracting the multiplied vector from the light direction vector. The set value can be 2.
[0091] One way to determine the third angle information between the viewpoint information and the reflected light direction is to use the dot product of the viewpoint direction vector and the reflected light direction vector as the third angle information.
[0092] The method of adjusting the light source color based on the third included angle information to obtain the target illumination color can be as follows: perform an exponential calculation on the third included angle information to set a highlight value, and multiply the result of the exponential calculation by the light source color to obtain the target illumination color. The set highlight value is a user-defined value. In this embodiment, adjusting the light source color based on the third included angle information can make local objects exhibit a highlight effect.
[0093] Correspondingly, the method of fusing the set color and the target lighting color based on the local object map to obtain the local object lighting effect map can be: fusing the set color and the target lighting color based on the smoothed local object map to obtain the local object lighting effect map.
[0094] The set color can be black, with a corresponding color value of (0,0,0). The method for fusing the set color and the target lighting color based on the smoothed local object map can be as follows: the pixel values of the smoothed local object map are used as weighting coefficients for the target lighting color; the result of subtracting the pixel values of the smoothed local object map from 1 is used as a weighting coefficient for the set color; and the set color and the target lighting color are then summed based on these weighting coefficients.
[0095] Specifically, the method to fuse the local object lighting map and the target object lighting map can be to add the pixel values of the local object lighting map to the corresponding pixel values of the target object lighting map.
[0096] Accordingly, the target object lighting map, background area lighting map, and backlighting map can be fused together to obtain the target lighting map.
[0097] The technical solution of this disclosure involves acquiring current light source information, a normal map of the original image, and a target object mask. The light source information includes light source color, light source position, and light intensity. A target lighting map is generated based on the normal map, the target object mask, and the light source information. The target lighting map and the original image are then fused to obtain a target lighting effect image. The method for generating effect images provided in this disclosure, which generates target lighting maps based on normal maps, target object masks, and light source information, can generate effect images with lighting effects, enriching the displayed content of the image.
[0098] Figure 5 This is a schematic diagram of the structure of a special effects image generation device provided in an embodiment of the present disclosure, as shown below. Figure 5 As shown, the device includes:
[0099] The acquisition module 510 is used to acquire current light source information, the normal map of the original image, and the mask map of the target object; wherein, the light source information includes light source color, light source position, and light intensity;
[0100] The target illumination map generation module 520 is used to generate a target illumination map based on the normal map, the target object mask map, and the light source information.
[0101] The target lighting effect image acquisition module 530 is used to fuse the target lighting image and the original image to obtain the target lighting effect image.
[0102] Optionally, the target lighting map generation module 520 is also used for:
[0103] Generate a target object illumination map based on the normal map, the light source information, and the target object mask map;
[0104] A background region illumination map is generated based on the light source information and the target object mask.
[0105] Generate a backlighting map based on the normal map and the target object mask map;
[0106] The target object lighting map, the background area lighting map, and the backlighting map are fused together to obtain the target lighting map.
[0107] Optionally, the target lighting map generation module 520 is also used for:
[0108] A first illumination intensity map is determined based on the normal map and the light source information;
[0109] The first illumination intensity map and the light source color are fused to obtain an initial illumination map;
[0110] The initial lighting map is fused with the target object mask map to obtain the target object lighting map.
[0111] Optionally, the target lighting map generation module 520 is also used for:
[0112] The first angle information between the incident ray and the pixel is determined based on the normal diagram and the light source information;
[0113] Attenuation information is determined based on the distance between the light source and the pixels in the original image;
[0114] The illumination intensity is adjusted based on the first included angle information and the attenuation information to obtain the target intensity of the pixel.
[0115] A first illumination intensity map is generated based on the target intensity of each pixel.
[0116] Optionally, the target lighting map generation module 520 is also used for:
[0117] Obtain the distance between the light source and the pixels in the original image;
[0118] A second illumination intensity map is generated based on the distance and the illumination intensity;
[0119] The second illumination intensity map is fused with the target object mask map to obtain an illumination intensity mask map;
[0120] The set color and the light color are fused based on the light intensity mask to obtain the background area light map.
[0121] Optionally, the target lighting map generation module 520 is also used for:
[0122] A first backlight intensity map is determined based on the normal map, the target object mask map, and the viewpoint information;
[0123] The target object mask image is reversed to obtain a reverse target object mask image;
[0124] A second backlight intensity map is generated based on the target object mask map and the reverse target object mask map;
[0125] The first backlight intensity map and the second backlight intensity map are fused together to obtain the target backlight intensity map;
[0126] The target backlight intensity map and the light source color are fused to obtain a backlight map.
[0127] Optionally, the target lighting map generation module 520 is also used for:
[0128] Determine the second angle information between the normal information of each pixel in the normal map and the view information;
[0129] The initial backlight intensity of each pixel is determined based on the second included angle information;
[0130] An initial backlight intensity map is generated based on the initial backlight intensity.
[0131] The initial backlight intensity map is fused with the target object mask map to obtain the first backlight intensity map.
[0132] Optionally, the target lighting map generation module 520 is also used for:
[0133] The target object mask and the reverse target object mask are blurred respectively to obtain a first blurred mask and a second blurred mask;
[0134] The second blurred mask image and the reverse target object mask image are fused to obtain a fused mask image;
[0135] The fused mask image is fused with the first blurred mask image to obtain the second backlight intensity image.
[0136] Optionally, it also includes: a target object lighting map update module, used for:
[0137] Obtain the grayscale image and local object mask of the original image; wherein, the local object is an object composed of local regions of the target object;
[0138] The grayscale image and the local object mask image are fused to obtain a local object image;
[0139] The color of the light source is adjusted based on the normal diagram, viewpoint information, and light source position to obtain the target illumination color;
[0140] Based on the local object image, the set color and the target lighting color are fused to obtain a local object lighting effect image;
[0141] The local object lighting map and the target object lighting map are fused to obtain an updated target object lighting map.
[0142] Optionally, the target object lighting map update module is also used for:
[0143] The grayscale image is smoothed to obtain a smoothed grayscale image;
[0144] The smoothed grayscale image and the local object mask image are fused to obtain a smoothed local object image;
[0145] Based on the local object map, the set color and the target lighting color are fused to obtain a local object lighting effect map, including:
[0146] The set color and the target lighting color are fused based on the smoothed local object map to obtain a local object lighting effect map.
[0147] Optionally, the target object lighting map update module is also used for:
[0148] The direction of reflected light is determined based on the normal diagram and the position of the light source;
[0149] Determine the included angle information between the viewing angle information and the direction of the reflected light;
[0150] The color of the light source is adjusted based on the third included angle information to obtain the target illumination color.
[0151] Optionally, the target lighting map generation module 520 is also used for:
[0152] The relative position between the light source and the target object is determined based on the first included angle information; wherein, the relative position includes the light source being in front of the target object, the light source being behind the target object, and the light source being to the side of the target object;
[0153] The target object illumination map, the background area illumination map, and the backlighting map are fused based on the relative position to obtain the target illumination map.
[0154] Optionally, the target lighting map generation module 520 is also used for:
[0155] If the light source is located in front of the target object, the target object lighting map and the background area lighting map are fused together to obtain the target lighting map;
[0156] If the light source is located behind the target object, the background area lighting map and the back lighting map are fused together to obtain the target lighting map;
[0157] If the light source is located to the side of the target object, then the target object lighting map and the back lighting map are interpolated and fused to obtain an intermediate lighting map;
[0158] The intermediate illumination map and the background area illumination map are fused together to obtain the target illumination map.
[0159] The special effects image generation apparatus provided in this disclosure can execute the special effects image generation method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0160] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0161] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 6 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 6 The diagram below shows the structure of the terminal device or server 500. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0162] like Figure 6 As shown, electronic device 500 may include a processing unit (e.g., central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. An edit / output (I / O) interface 505 is also connected to bus 504.
[0163] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0164] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0165] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0166] The electronic device provided in this embodiment and the method for generating special effects images provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0167] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the method for generating special effects images provided in the above embodiments.
[0168] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0169] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0170] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0171] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to:
[0172] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire current light source information, a normal map of the original image, and a target object mask map; wherein the light source information includes light source color, light source position, and light intensity; generate a target lighting map based on the normal map, the target object mask map, and the light source information; and fuse the target lighting map and the original image to obtain a target lighting effect map.
[0173] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0174] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0175] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0176] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0177] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0178] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0179] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0180] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for generating special effects images, characterized in that, include: Acquire the current light source information, the normal map of the original image, and the mask map of the target object; wherein, the light source information includes the light source color, the light source position, and the light intensity; Generate a target illumination map based on the normal map, the target object mask map, and the light source information; The target lighting map and the original image are fused together to obtain a target lighting effect map; Generating a target illumination map based on the normal map, the target object mask map, and the light source information includes: Generate a target object illumination map based on the normal map, the light source information, and the target object mask map; A background region illumination map is generated based on the light source information and the target object mask. Generate a backlighting map based on the normal map and the target object mask map; The target object lighting map, the background area lighting map, and the backlighting map are fused together to obtain the target lighting map.
2. The method according to claim 1, characterized in that, Generating a target object illumination map based on the normal map, the light source information, and the target object mask map includes: A first illumination intensity map is determined based on the normal map and the light source information; The first illumination intensity map and the light source color are fused to obtain an initial illumination map; The initial lighting map is fused with the target object mask map to obtain the target object lighting map.
3. The method according to claim 2, characterized in that, Determining the first illumination intensity map based on the normal map and the light source information includes: The first angle information between the incident ray and the pixel is determined based on the normal diagram and the light source information; Attenuation information is determined based on the distance between the light source and the pixels in the original image; The illumination intensity is adjusted based on the first included angle information and the attenuation information to obtain the target intensity of the pixel. A first illumination intensity map is generated based on the target intensity of each pixel.
4. The method according to claim 1, characterized in that, Generate a background region illumination map based on the light source information and the target object mask map, including: Obtain the distance between the light source and the pixels in the original image; A second illumination intensity map is generated based on the distance and the illumination intensity; The second illumination intensity map is fused with the target object mask map to obtain an illumination intensity mask map; The set color and the light color are fused based on the light intensity mask to obtain the background area light map.
5. The method according to claim 1, characterized in that, Generating a backlighting map based on the normal map and the target object mask map includes: A first backlight intensity map is determined based on the normal map, the target object mask map, and the viewpoint information; The target object mask image is reversed to obtain a reverse target object mask image; A second backlight intensity map is generated based on the target object mask map and the reverse target object mask map; The first backlight intensity map and the second backlight intensity map are fused together to obtain the target backlight intensity map; The target backlight intensity map and the light source color are fused to obtain a backlight map.
6. The method according to claim 5, characterized in that, Determining the first backlight intensity map based on the normal map, the target object mask map, and the viewing angle information includes: Determine the second angle information between the normal information of each pixel in the normal map and the view information; The initial backlight intensity of each pixel is determined based on the second included angle information; An initial backlight intensity map is generated based on the initial backlight intensity. The initial backlight intensity map is fused with the target object mask map to obtain the first backlight intensity map.
7. The method according to claim 5, characterized in that, Generating a second backlight intensity map based on the target object mask and the reverse target object mask includes: The target object mask and the reverse target object mask are blurred respectively to obtain a first blurred mask and a second blurred mask; The second blurred mask image and the reverse target object mask image are fused to obtain a fused mask image; The fused mask image is fused with the first blurred mask image to obtain the second backlight intensity image.
8. The method according to claim 1, characterized in that, Also includes: Obtain the grayscale image and local object mask of the original image; wherein, the local object is an object composed of local regions of the target object; The grayscale image and the local object mask image are fused to obtain a local object image; The color of the light source is adjusted based on the normal diagram, viewpoint information, and light source position to obtain the target illumination color; Based on the local object image, the set color and the target lighting color are fused to obtain a local object lighting effect image; The local object lighting map and the target object lighting map are fused to obtain an updated target object lighting map.
9. The method according to claim 8, characterized in that, The grayscale image and the local object mask image are fused to obtain a local object image, including: The grayscale image is smoothed to obtain a smoothed grayscale image; The smoothed grayscale image and the local object mask image are fused to obtain a smoothed local object image; Based on the local object map, the set color and the target lighting color are fused to obtain a local object lighting effect map, including: The set color and the target lighting color are fused based on the smoothed local object map to obtain a local object lighting effect map.
10. The method according to claim 8, characterized in that, The target illumination color is obtained by adjusting the light source color based on the normal diagram, viewpoint information, and light source position, including: The direction of reflected light is determined based on the normal diagram and the position of the light source; Determine the included angle information between the viewing angle information and the direction of the reflected light; The color of the light source is adjusted based on the third included angle information to obtain the target illumination color.
11. The method according to claim 3, characterized in that, The target object lighting map, the background region lighting map, and the backlighting map are fused to obtain the target lighting map, including: The relative position between the light source and the target object is determined based on the first included angle information; wherein, the relative position includes the light source being in front of the target object, the light source being behind the target object, and the light source being to the side of the target object; The target object illumination map, the background area illumination map, and the backlighting map are fused based on the relative position to obtain the target illumination map.
12. The method according to claim 11, characterized in that, Based on the relative position, the target object lighting map, the background region lighting map, and the backlighting map are fused to obtain a target lighting map, including: If the light source is located in front of the target object, the target object lighting map and the background area lighting map are fused together to obtain the target lighting map; If the light source is located behind the target object, the background area lighting map and the back lighting map are fused together to obtain the target lighting map; If the light source is located to the side of the target object, then the target object lighting map and the back lighting map are interpolated and fused to obtain an intermediate lighting map; The intermediate illumination map and the background area illumination map are fused together to obtain the target illumination map.
13. A device for generating special effects images, characterized in that, include: The acquisition module is used to acquire current light source information, the normal map of the original image, and the mask map of the target object; wherein, the light source information includes light source color, light source position, and light intensity; The target illumination map generation module is used to generate a target illumination map based on the normal map, the target object mask map, and the light source information; The target lighting effect image acquisition module is used to fuse the target lighting image and the original image to obtain the target lighting effect image; The target illumination map generation module is also used for: Generate a target object illumination map based on the normal map, the light source information, and the target object mask map; A background region illumination map is generated based on the light source information and the target object mask. Generate a backlighting map based on the normal map and the target object mask map; The target object lighting map, the background area lighting map, and the backlighting map are fused together to obtain the target lighting map.
14. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating special effects images as described in any one of claims 1-12.
15. A storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the method for generating special effects graphics as described in any one of claims 1-12.