Special effect processing method and apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202310118722.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-30
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-01-30
AI Technical Summary
[0003]相关技术中,通常会将预先设置的特效对象与视频中的图像帧直接叠加显示,这种特效处理方式,使得特效对象在图像帧中的显示方式较为生硬,影响用户的使用体验
[0017]第四方面,本公开实施例还提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如本公开实施例中任一所述的特效处理方法。
Smart Images

Figure CN116112755B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to special effects processing technology, and more particularly to a special effects processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of multimedia technology, various special effects are being applied to videos to enrich their presentation. A typical approach is to add a variety of special effects objects to the video.
[0003] In related technologies, pre-set special effects objects are usually overlaid directly on image frames in the video. This special effects processing method makes the display of special effects objects in the image frames look rather abrupt, affecting the user experience. Summary of the Invention
[0004] This disclosure provides a special effects processing method, apparatus, electronic device, and storage medium to enhance the display effect of special effects objects.
[0005] In a first aspect, embodiments of this disclosure provide a special effects processing method, the method comprising:
[0006] In response to the effect addition operation, obtain the image to be processed and the effect object to be added;
[0007] If the image to be processed includes an object corresponding to the special effect object, the blurred rendering area of the special effect object is determined based on the special effect object and the object.
[0008] The blurred rendering area is blurred, and the blurred special effect object is applied to the applied object to obtain the special effect image, and the special effect image is displayed.
[0009] Secondly, this disclosure also provides a special effects processing apparatus, which includes:
[0010] The special effects triggering module is used to respond to the special effects addition operation by obtaining the image to be processed and the special effects object to be added;
[0011] The blurred region determination module is used to determine the blurred rendering region of the special effect object based on the special effect object and the special effect object when the image to be processed includes an object corresponding to the special effect object.
[0012] The special effects display module is used to blur the blurred rendering area, apply the blurred special effects object to the applied object to obtain a special effects image, and display the special effects image.
[0013] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0014] One or more processors;
[0015] Storage device for storing one or more programs.
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the special effects processing method as described in any of the embodiments of this disclosure.
[0017] 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 special effects processing methods as described in any of the embodiments of this disclosure.
[0018] The technical solution of this disclosure, in response to an effect addition operation, automatically acquires the image to be processed and the effect object to be added, enabling simple and convenient activation of effects. Then, if the image to be processed includes an object corresponding to the effect object, the blurred rendering area of the effect object is determined based on the effect object and the object, allowing for targeted generation of the blurred rendering area and ensuring the desired effect of both the effect object and the object. Finally, the blurred rendering area is blurred, and the blurred effect object is applied to the object to obtain the effect image. Displaying the effect image allows for intuitive observation of the effect, solving the technical problem of stiff effect display. It eliminates the need for complex and professional manual processing; simple user-triggered operations are sufficient for automated processing and displaying the blurred effect, broadening its applicability. Furthermore, it enhances the depth of field of the image, increasing its aesthetic appeal and improving the user experience. Attached Figure Description
[0019] 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.
[0020] Figure 1 A schematic flowchart illustrating a special effects processing method provided in an embodiment of this disclosure;
[0021] Figure 2 A schematic flowchart illustrating a special effects processing method provided in an embodiment of this disclosure;
[0022] Figure 3 This is a flowchart illustrating a special effects processing method provided in an embodiment of this disclosure;
[0023] Figure 4 This is a schematic diagram of the structure of a special effects processing device provided in an embodiment of the present disclosure;
[0024] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0025] 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.
[0026] 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.
[0027] 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.
[0028] 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.
[0029] 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".
[0030] 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.
[0031] 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.
[0032] 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.
[0033] 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.
[0034] 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.
[0035] 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.
[0036] Figure 1 This is a flowchart illustrating a special effects processing method provided in an embodiment of the present disclosure. This embodiment is applicable to situations where a portion of a special effects object is blurred. The method can be executed by a special effects processing device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.
[0037] like Figure 1 As shown, the method in this embodiment may specifically include:
[0038] S110, In response to the effect addition operation, obtain the image to be processed and the effect object to be added.
[0039] The effects addition operation is used to add effects objects to the image to be processed.
[0040] Optionally, the effect addition operation can be an effect triggering operation for the effect to be added. For example, an effect triggering operation for the effect to be added can be: triggering a pre-set effect enabling control corresponding to the effect to be added, or inputting an effect enabling control command corresponding to the effect to be added, such as sound and / or gesture. Typically, the effect enabling control can be represented by an effect icon corresponding to the effect to be added. The effect icon can be displayed as text and / or an image.
[0041] The image to be processed can be understood as an image to be processed with special effects, or an image obtained after enabling the special effects to be added. Optionally, the image to be processed can be an image taken with the special effects to be added, or an image uploaded with the special effects to be added. It should be noted that the image content of the image to be processed is not limited in this embodiment.
[0042] The special effect object to be added can be understood as an object corresponding to the special effect to be added and used to add to the image to be processed. In this embodiment of the disclosure, the special effect object can take many forms. For example, the special effect object can be a decoration or accessory displayed in the image to be processed. For example, the special effect object can be at least one of objects such as a watch, bracelet, necklace, and earrings. It is understood that there can be one or more special effect objects to be added.
[0043] S120. If the image to be processed includes an object corresponding to the special effect object, determine the blurred rendering area of the special effect object based on the special effect object and the object.
[0044] The target object can be understood as an object displayed in the image to be processed that is associated with the special effect object. The target object may include, but is not limited to, a pre-defined type of image subject in the image to be processed. The image subject can be a region of interest in the image to be processed. For example, the image subject can be a scene subject such as a person, animal, plant, or building in the image to be processed. The image subject can also be part or all of a scene subject. For example, the image subject can be at least one of the following parts of a person: hand (e.g., fingers or wrist), neck, head, ear, nose, leg, and foot (e.g., toes or ankle). Optionally, the image subject can also be a foreground or background region in the image to be processed. It is understood that the image to be processed may include one or more target objects corresponding to the special effect object.
[0045] In practical applications, the content of the images to be processed is diverse. To ensure the effectiveness of special effects, the special effect objects can be displayed in correspondence with preset object types. Therefore, if the image to be processed includes an object corresponding to the special effect object, the special effect object can be processed and displayed separately.
[0046] Optionally, a correspondence between effect objects and their corresponding objects can be pre-defined. After acquiring the image to be processed, the image is detected to determine whether it contains an object corresponding to the effect object. Specifically, the main subject in the image to be processed is detected to determine whether a preset type of main subject exists. If so, the preset type of main subject is used as the object corresponding to the effect object. Optionally, the detection of the main subject in the image to be processed includes: detecting the main subject in the image to be processed based on an image detection model, wherein the image detection model is trained based on a pre-established artificial intelligence model. The artificial intelligence model may include, but is not limited to, machine learning models or deep learning models, for example, a convolutional neural network.
[0047] The blurred rendering area can be understood as the area to be blurred and then rendered. In this embodiment, the blurred rendering area of the special effect object can be the entire area or a part of the special effect object. Optionally, determining the blurred rendering area of the special effect object based on the special effect object and the acting object includes: determining the connection area between the special effect object and the acting object, and using the connection area as the blurred rendering area of the special effect object. For example, the connection area can be the area connecting the edge of the special effect object and the edge of the acting object. For example, in some scenarios, a part of the special effect object may be occluded by the acting object. Suppose that the visible part after the special effect object is applied to its corresponding acting object is called the display area, and the part of the special effect object occluded by the acting object is called the occluded area. In this case, the blurred rendering area of the special effect object can be a part of the display area of the special effect object adjacent to the occluded area.
[0048] S130. Blur the rendered area, apply the blurred effect object to the target object to obtain the effect image, and display the effect image.
[0049] In this context, blurring can be understood as weakening the pixels in the blurred rendering area. The special effects image can be understood as the image obtained after being added to the image to be processed. Specifically, each pixel in the blurred rendering area can be uniformly or differentially processed to give the pixels in the blurred rendering area a blurred effect. Blurring the blurred rendering area of the special effects object can make the display effect of the special effects object softer, thereby improving the special effects image obtained after the special effects object acts on the applied object.
[0050] In this embodiment of the disclosure, there are multiple ways to blur the rendered area of the special effects object, and the specific method used can be set according to actual needs.
[0051] Optionally, blurring the blurred rendering area includes: blurring the blurred rendering area according to the arrangement information of each pixel in the blurred rendering area. For example, the edge pixels of the blurred rendering area can be used as starting pixels, and the pixels in the blurred rendering area can be blurred in units of pixel rows or pixel columns. Wherein, the pixel values of each pixel in the same pixel row are the same or can change according to a preset variation method. Similarly, the pixel values of each pixel in the same pixel column are the same, or can change according to a preset variation method.
[0052] Furthermore, the way to blur the pixels in the blurred rendering area can be by adjusting the pixel values of the pixels in the blurred rendering area using preset pixel values, or by adjusting the transparency of the pixels in the blurred rendering area, etc.
[0053] To ensure the real-time processing of special effects, optionally, the special effects image is displayed in real time after it is obtained.
[0054] The technical solution of this disclosure, in response to an effect addition operation, automatically acquires the image to be processed and the effect object to be added, enabling simple and convenient activation of effects. Then, if the image to be processed includes an object corresponding to the effect object, the blurred rendering area of the effect object is determined based on the effect object and the object, allowing for targeted generation of the blurred rendering area and ensuring the desired effect of both the effect object and the object. Finally, the blurred rendering area is blurred, and the blurred effect object is applied to the object to obtain the effect image. Displaying the effect image allows for intuitive observation of the effect, solving the technical problem of stiff effect display. It eliminates the need for complex and professional manual processing; simple user-triggered operations are sufficient for automated processing and displaying the blurred effect, broadening its applicability. Furthermore, it enhances the depth of field of the image, increasing its aesthetic appeal and improving the user experience.
[0055] Figure 2 This is a flowchart illustrating another special effects processing method provided in this embodiment. Based on the above embodiments, this embodiment further refines how to determine the blurred rendering area. Optionally, determining the blurred rendering area of the special effects object based on the special effects object and the object acting on it includes: determining an occlusion model corresponding to the special effects object, wherein the occlusion model is used to occlude the area of the special effects object occluded by the object acting on it; determining a blurring model corresponding to the object acting on it; and determining the blurred rendering area of the special effects object based on the blurring model and the occlusion model. For detailed implementation, please refer to the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here.
[0056] like Figure 2 As shown, the method in this embodiment may specifically include:
[0057] S210, In response to the effect addition operation, obtain the image to be processed and the effect object to be added.
[0058] S220. If the image to be processed includes an object corresponding to the special effect object, determine the occlusion model corresponding to the special effect object.
[0059] Among them, the occlusion model is used to occlude the area of the special effect object that is occluded by the applied object.
[0060] Understandably, to ensure the occlusion effect of the occlusion model on the special effects object, the occlusion model can correspond to the object model of the special effects object. Optionally, determining the occlusion model corresponding to the special effects object includes: determining the object model of the special effects object, and obtaining the occlusion model corresponding to the special effects object based on the object model. The object model can be understood as a 3D model of the special effects object.
[0061] In this embodiment of the disclosure, the style of the special effects object can be diverse. For example, an occlusion model corresponding to each special effects object or each type of special effects object can be pre-constructed. Optionally, an occlusion model corresponding to the special effects object can be constructed based on the object model of the special effects object, or an occlusion model corresponding to the special effects object can be constructed based on the object acting on the special effects object, etc.
[0062] Optionally, obtaining the occlusion model corresponding to the special effects object based on the object model includes: obtaining a pre-constructed occlusion model corresponding to the object model as the occlusion model corresponding to the special effects object. For example, a mapping relationship between the object model of the special effects object and the occlusion model can be established. For instance, the identifier of the object model of the special effects object can be stored in correspondence with the identifier of the occlusion model. Specifically, the identifier of the occlusion model can be determined based on the mapping relationship and the identifier of the object model of the special effects object; then, the occlusion model can be obtained based on the identifier of the occlusion model; and the occlusion model corresponding to the special effects object can be determined based on the obtained occlusion model.
[0063] Specifically, determining the occlusion model corresponding to the special effects object based on the acquired occlusion model includes: using the acquired occlusion model as the occlusion model corresponding to the special effects object, or receiving a first adjustment operation on the acquired occlusion model and using the adjusted occlusion model as the occlusion model corresponding to the special effects object. The first adjustment operation includes adjusting information such as the size and / or shape of the occlusion model.
[0064] In practical applications, the objects to be processed in the image often exhibit various differences. Optionally, an occlusion model corresponding to the effect object is generated based on multiple edge points of the effect object. The advantage of this setting is that it allows for a higher degree of matching between the effect object and the object being processed, resulting in a better relative display effect between the two.
[0065] Before generating an occlusion model corresponding to the special effect object based on multiple edge points of the target object, the target object corresponding to the special effect object in the image to be processed can be determined first. Then, the edges of the target object are detected to obtain multiple edge points of the target object. There are various ways to detect the edges of the target object; for example, the edges of the target object can be detected based on a pre-trained edge detection model. The edge detection model can be an artificial intelligence model. To ensure the edge detection model's effectiveness for the target object, the edge detection model can be trained separately for each type of target object. Specifically, the edge detection model can be trained based on a sample image and a corresponding labeled image. The standard image is a sample image labeled with the sample edge points of the target object.
[0066] When the image to be processed is a 3D image, specifically, an occlusion model corresponding to the object can be constructed using multiple edge points of the object as vertices. When the image to be processed is a 2D image, the 2D coordinates of the multiple edge points of the object can be first converted into 3D coordinates, and then the occlusion model corresponding to the object can be constructed using the 3D coordinates as vertices. Optionally, there are several ways to convert the 2D coordinates of the multiple edge points of the object into 3D coordinates. For example, a preset depth value can be added to each edge point to obtain its 3D coordinates. For example, the preset depth value can be -1.
[0067] To ensure that the occlusion model matches the size of the effect object and the object being processed, and also matches their display position in the image to be processed, optionally, generating an occlusion model corresponding to the effect object based on multiple edge points of the effect object includes: mapping the screen of multiple edge points of the effect object onto the near clipping plane of the camera to obtain a projection patch, and determining the occlusion model corresponding to the effect object based on the projection patch.
[0068] Specifically, for each edge point, based on the screen coordinates of the edge point on the display screen and the size ratio between the near clipping plane and the display screen in the model space, the mapping point corresponding to the edge point on the near clipping plane is determined. Then, the mapping points corresponding to multiple edge points are used as vertices for rendering to obtain the projection surface corresponding to the edge point.
[0069] The near clipping plane is a pre-defined clipping plane in the model space, and its size ratio to the display screen is fixed. In other words, the coordinates of points on the near clipping plane can be matched with the coordinates of points on the display screen according to the size ratio between the near clipping plane and the display screen.
[0070] Further, determining the occlusion model corresponding to the special effects object based on the projection surface includes: determining the occlusion model corresponding to the special effects object based on the size ratio between the projection surface and the near-cropping surface and the display screen. Specifically, the projection surface can be enlarged or reduced according to the size ratio between the near-cropping surface and the display screen to obtain the occlusion model corresponding to the special effects object.
[0071] S230. Determine the blurring model corresponding to the target object, and determine the blurring rendering area of the special effect object based on the blurring model and the occlusion model.
[0072] The blurring model can be understood as a model used to determine the blurring rendering area of the special effects object. Optionally, a pre-established reference model corresponding to the effect object is obtained, and the blurring model corresponding to the effect object is determined based on the reference model. For example, the shape and size of the effect object can be determined, and then a reference model corresponding to the effect object can be established based on the shape and size of the effect object. The size of the effect object can be the size of a single effect object, or the average size of multiple effect objects, etc.
[0073] Specifically, determining the blurring model corresponding to the target object based on the reference model includes: using the acquired reference model as the blurring model corresponding to the special effects object, or receiving a second adjustment operation on the acquired reference model and using the adjusted reference model as the blurring model corresponding to the special effects object. The second adjustment operation includes adjusting information such as the size and / or shape of the reference model. The advantage of this setup is that it ensures the blurring model matches the target object.
[0074] Optionally, determining the blurred model corresponding to the target object includes: enlarging the occlusion model to obtain the blurred model. Specifically, the occlusion model can be enlarged proportionally according to a preset enlargement ratio to obtain the blurred model. The specific value of the enlargement ratio can be set according to actual conditions and is not specifically limited here. For example, the edge pixels of the occlusion model can be used as reference pixels to enlarge the occlusion model to obtain the blurred model. In other words, each edge pixel of the occlusion model can be expanded outward by a preset number of pixels to obtain the blurred model.
[0075] In this embodiment of the disclosure, in order to ensure the interaction effect between the image to be processed and the special effects object, and to reduce the interference of the virtual model on the image effect, the model display information of the blurred model can be determined based on the image information of the image to be processed. Optionally, for each model pixel in the blurred model, the pixel value of the model pixel is determined based on the pixel value of the image pixel in the image to be processed corresponding to the model pixel. The model pixel can be the pixel to be processed in the blurred model.
[0076] Specifically, determining the pixel value of the model pixel based on the pixel value of the image pixel corresponding to the model pixel in the image to be processed can include: using the pixel value of the image pixel corresponding to the model pixel in the image to be processed as the pixel value of the model pixel, or adjusting the pixel value of the image pixel corresponding to the model pixel in the image to be processed to obtain the pixel value of the model pixel. The advantage of this setting is that it can weaken the display effect of the blurred model in the image to be processed, achieving a visualization effect of hiding the blurred model within the image to be processed.
[0077] In this embodiment of the disclosure, the size of the blurred model is not smaller than that of the occlusion model. Optionally, determining the blurred rendering area of the special effects object based on the blurred model and the occlusion model includes: determining the non-overlapping area of the blurred model and the occlusion model, and using the non-overlapping area as the blurred rendering area of the special effects object. For example, the centers of the blurred model and the occlusion model can be aligned to determine the non-overlapping area. When the blurred model is obtained by enlarging the occlusion model, the expanded area of the blurred model relative to the occlusion model is the blurred rendering area of the special effects object.
[0078] The advantage of using the non-overlapping areas of the blurred model and the occluding model as the blurred rendering area of the special effects object is that at least a portion of the visual area of the special effects object can be blurred without processing the part of the special effects object that is occluded by the occluding model, reducing invalid processing, improving the efficiency of blurring processing, and ensuring the visualization effect of blurring the special effects object.
[0079] S240. Blur the rendered area, apply the blurred effect object to the target object to obtain the effect image, and display the effect image.
[0080] The technical solution of this disclosure, through an occlusion model corresponding to the special effects object, can determine the visualization effect of the special effects object on the target object. By using a blurring model and an occlusion model corresponding to the target object, a blurring rendering area that matches both the special effects object and the target object can be specifically determined, thereby ensuring the blurring effect of the special effects object and improving the special effects overall.
[0081] Figure 3 This is a flowchart illustrating another special effects processing method provided in this embodiment. Based on the above embodiments, this embodiment further refines how to perform blurring processing on the blurred rendering area. Optionally, the blurring processing of the blurred rendering area includes: for the pixel to be blurred in the blurred rendering area, determining a first pixel value in the blurred model and a second pixel value in the special effects object; and determining a target pixel value for the pixel to be blurred based on the first pixel value and the second pixel value. For detailed implementation, please refer to the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here.
[0082] like Figure 3 As shown, the method in this embodiment may specifically include:
[0083] S310, In response to the effect addition operation, obtain the image to be processed and the effect object to be added.
[0084] S320. If the image to be processed includes an object corresponding to the special effect object, determine the occlusion model corresponding to the special effect object.
[0085] S330. Determine the blurring model corresponding to the target object, and determine the blurring rendering area of the special effect object based on the blurring model and the occlusion model.
[0086] S340. For the pixels to be blurred in the blurred rendering area, determine the first pixel value of the pixel to be blurred in the blurred model and the second pixel value of the pixel to be blurred in the effect object.
[0087] Here, the pixel to be blurred can be understood as the pixel in the blurred rendering area that needs to be blurred. The first pixel value can be understood as the pixel value of the pixel to be blurred in the blurred model. As mentioned earlier, the display information of the blurred model can be consistent with the display information of the image to be processed. For example, the first pixel value can be understood as the pixel value of the pixel to be blurred in the image to be processed. The second pixel value can be understood as the pixel value of the pixel to be blurred in the effect object.
[0088] S350. Based on the first pixel value and the second pixel value, determine the target pixel value of the pixel to be blurred.
[0089] In this embodiment of the disclosure, the first pixel value and the second pixel value can be fused to obtain the target pixel value of the pixel to be blurred. There are various ways to fuse the first pixel value and the second pixel value, such as fusing the first pixel value and the second pixel value based on a preset weight value.
[0090] Optionally, the transparency of the pixel to be blurred in the blurring model is determined, and then, based on the transparency, the first pixel value, and the second pixel value, the target pixel value of the pixel to be blurred is determined. By adjusting the transparency of the blurring model, the display effect of the first pixel value on the pixel to be blurred is adjusted, and then the display effect of the second pixel value of the effect object is adjusted by the first pixel value, thereby achieving the blurring processing of the pixel to be blurred.
[0091] In this embodiment, there are multiple ways to determine the transparency of the pixel to be blurred in the blurred model. Optionally, the viewing information corresponding to the pixel to be blurred and the normal information at the pixel to be blurred in the blurred model are determined; the transparency of the pixel to be blurred in the blurred model is determined based on the viewing information and the normal information. The advantage of this setting is that it makes the blurring effect more in line with visual habits and ensures the visualization effect of the pixel to be blurred in the blurred rendering area.
[0092] In this process, the normal information at the pixel to be blurred in the blurred model can be determined using geometric methods. For example, first determine the tangent at the pixel to be blurred in the blurred model, and then determine the normal at the pixel to be blurred in the blurred model based on the tangent. Optionally, the blurred model can be cut based on the pixel to be blurred to obtain a cross-section of the model corresponding to the pixel to be blurred, and then the normal information at the pixel to be blurred can be calculated based on the cross-section of the model. Specifically, a normal algorithm for calculating the pixel to be blurred is used based on the shape of the cross-section of the model, and then the normal information at the pixel to be blurred is calculated based on the normal algorithm. To ensure the efficiency of normal information calculation, a normal algorithm corresponding to the shape of the cross-section of the model can be preset. Taking an elliptical cross-section of the model as an example, the normal information at the pixel to be blurred can be determined by the ratio of the major axis to the minor axis.
[0093] Optionally, the transparency of the pixel to be blurred in the blurring model is determined based on the line-of-sight information and normal information, specifically including: multiplying the line-of-sight information and normal information to obtain a fusion value, and determining the transparency of the pixel to be blurred in the blurring model based on the fusion value.
[0094] For example, the blend value can be used as the transparency of the pixel to be blurred in the blurred model, or the blend value can be adjusted based on preset adjustment parameters to obtain the transparency of the pixel to be blurred in the blurred model. The preset adjustment parameters can be understood as pre-set parameters used to adjust the size of the blend value. These adjustment parameters can be made available to the user for independent setting. Furthermore, the system can receive parameter setting operations for the preset adjustment parameters, and adjust the blend value based on the set parameter value to obtain the transparency of the pixel to be blurred in the blurred model. The method of adjusting the blend value based on the set parameter value can be, for example, multiplying the set parameter value by the blend value.
[0095] Optionally, determining the transparency of the pixels to be blurred in the blurred model includes: determining the transparency of the pixels to be blurred in the blurred model based on the grayscale values corresponding to the pixels to be blurred in the blurred model. For example, the grayscale values corresponding to the model pixels in the blurred model can be preset, and then the grayscale values corresponding to the pixels to be blurred in the blurred model can be determined. Alternatively, the grayscale values of the pixels to be blurred in the blurred rendering area can be preset. For example, the grayscale values corresponding to the pixels to be blurred can be used as the transparency of the pixels to be blurred in the blurred model. The grayscale values of the pixels to be blurred in the blurred rendering area can gradually change according to the extension direction of the effect object, from dark to light or from light to dark. For example, the grayscale values corresponding to the pixels to be blurred closer to the occluding model are lighter, and the grayscale values corresponding to the pixels to be blurred farther from the occluding model are darker. It is understood that the specific values of the grayscale values corresponding to the pixels to be blurred can be set according to actual needs and are not specifically limited here.
[0096] S360. Apply the blurred special effects object to the target object to obtain the special effects image, and display the special effects image.
[0097] The technical solution of this embodiment achieves the blurring of the rendering area of the special effects object by fusing the first pixel value of the pixel to be blurred in the blurring model and the second pixel value of the pixel to be blurred in the special effects object, thus making the display effect of the special effects object more layered. Since the blurring model corresponds to the target object, the blurring effect of the special effects object is more closely matched with the target object.
[0098] Figure 4 This is a schematic diagram of the structure of a special effects processing device provided in an embodiment of this disclosure. Figure 4 As shown, the special effects processing device includes: a special effects triggering module 410, a blurring area determination module 420, and a special effects display module 430.
[0099] The system includes a special effects triggering module 410, which is used to acquire the image to be processed and the special effects object to be added in response to the special effects addition operation; a blurring region determination module 420, which is used to determine the blurring rendering region of the special effects object based on the special effects object and the special effects object when the image to be processed includes an object corresponding to the special effects object; and a special effects display module 430, which is used to blur the blurring rendering region, apply the blurred special effects object to the object to obtain the special effects image, and display the special effects image.
[0100] The technical solution of this disclosure, in response to an effect addition operation, automatically acquires the image to be processed and the effect object to be added, enabling simple and convenient activation of effects. Then, if the image to be processed includes an object corresponding to the effect object, the blurred rendering area of the effect object is determined based on the effect object and the object, allowing for targeted generation of the blurred rendering area and ensuring the desired effect of both the effect object and the object. Finally, the blurred rendering area is blurred, and the blurred effect object is applied to the object to obtain the effect image. Displaying the effect image allows for intuitive observation of the effect, solving the technical problem of stiff effect display. It eliminates the need for complex and professional manual processing; simple user-triggered operations are sufficient for automated processing and displaying the blurred effect, broadening its applicability. Furthermore, it enhances the depth of field of the image, increasing its aesthetic appeal and improving the user experience.
[0101] Based on any of the optional technical solutions in the embodiments of this disclosure, the blurred region determination module may optionally include an occlusion model determination unit and a blurred region determination unit.
[0102] The occlusion model determination unit is used to determine the occlusion model corresponding to the special effect object, wherein the occlusion model is used to occlude the area of the special effect object that is occluded by the effect object; the blur region determination unit is used to determine the blur model corresponding to the effect object, and determine the blur rendering region of the special effect object based on the blur model and the occlusion model.
[0103] Based on any optional technical solution in the embodiments of this disclosure, the occlusion model determination unit can be specifically used to: determine the object model of the special effect object, and obtain the occlusion model corresponding to the special effect object based on the object model.
[0104] Based on any optional technical solution in the embodiments of this disclosure, the occlusion model determination unit can be specifically used to: generate an occlusion model corresponding to the special effect object based on multiple edge points of the object being applied.
[0105] Based on any optional technical solution in the embodiments of this disclosure, the occlusion model determination unit can be further used to: map the screen of multiple edge points of the target object onto the near clipping plane of the camera to obtain a projection surface, and determine the occlusion model corresponding to the special effect object based on the projection surface.
[0106] Based on any optional technical solution in the embodiments of this disclosure, the blurred region determination unit can be specifically used to: enlarge the occlusion model to obtain a blurred model.
[0107] Based on any optional technical solution in the embodiments of this disclosure, the blurring region determination unit can be specifically used to: determine the non-overlapping region of the blurring model and the occlusion model, and use the non-overlapping region as the blurring rendering region of the special effect object.
[0108] Based on any optional technical solution in the embodiments of this disclosure, the special effects display module may specifically include: a model pixel value determination module and a target pixel value determination module. The model pixel value determination module is used to determine, for the pixel to be blurred in the blurred rendering area, a first pixel value in the blurred model and a second pixel value in the special effects object; the target pixel value determination module is used to determine the target pixel value of the pixel to be blurred based on the first pixel value and the second pixel value.
[0109] Based on any optional technical solution in the embodiments of this disclosure, the special effects processing device may further include:
[0110] The virtual model coloring module is used to determine the pixel value of each model pixel in the blurred model based on the pixel value of the image pixel in the image to be processed that corresponds to the model pixel before determining the first pixel value of the pixel to be blurred in the blurred model.
[0111] Based on any optional technical solution in the embodiments of this disclosure, the target pixel value determination module may specifically include: a transparency determination unit and a pixel value update unit. The transparency determination unit is used to determine the transparency of the pixel to be blurred in the blurring model; the pixel value update unit is used to determine the target pixel value of the pixel to be blurred based on the transparency, the first pixel value, and the second pixel value.
[0112] Based on any optional technical solution in the embodiments of this disclosure, the transparency determination unit can be used to: determine the line-of-sight information corresponding to the pixel to be blurred and the normal information at the pixel to be blurred in the blurred model; and determine the transparency of the pixel to be blurred in the blurred model based on the line-of-sight information and the normal information.
[0113] Based on any optional technical solution in the embodiments of this disclosure, the transparency determination unit can be further used to: multiply the line-of-sight information and the normal information to obtain a fusion value, and determine the transparency of the pixel to be blurred in the blurring model based on the fusion value.
[0114] Based on any optional technical solution in the embodiments of this disclosure, the transparency determination unit can be used to: determine the transparency of the pixel to be blurred in the bokeh model based on the grayscale value corresponding to the pixel to be blurred in the bokeh model.
[0115] The special effects processing apparatus provided in this disclosure can execute the special effects processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the special effects processing method.
[0116] 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.
[0117] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 5 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 5 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 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0118] like Figure 5 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.
[0119] 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 5An 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.
[0120] 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.
[0121] 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.
[0122] The electronic device provided in this embodiment and the special effects processing method 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.
[0123] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the special effects processing method provided in the above embodiments.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: in response to an effect addition operation, acquire an image to be processed and an effect object to be added; if the image to be processed includes an object corresponding to the effect object, determine a blurred rendering area of the effect object based on the effect object and the object; blur the blurred rendering area, apply the blurred effect object to the object to obtain an effect image, and display the effect image.
[0128] 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).
[0129] 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.
[0130] 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".
[0131] 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.
[0132] 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.
[0133] According to one or more embodiments of this disclosure, [Example 1] provides a special effects processing method, including:
[0134] In response to the effect addition operation, obtain the image to be processed and the effect object to be added;
[0135] If the image to be processed includes an object corresponding to the special effect object, the blurred rendering area of the special effect object is determined based on the special effect object and the object.
[0136] The blurred rendering area is blurred, and the blurred special effect object is applied to the applied object to obtain the special effect image, and the special effect image is displayed.
[0137] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, further comprising:
[0138] Optionally, determining the blurred rendering area of the effect object based on the effect object and the object acting on it includes:
[0139] Determine an occlusion model corresponding to the special effect object, wherein the occlusion model is used to occlude the area of the special effect object that is occluded by the effect object;
[0140] Determine the blurring model corresponding to the target object, and determine the blurring rendering area of the effect object based on the blurring model and the occlusion model.
[0141] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, which further includes:
[0142] Optionally, determining the occlusion model corresponding to the special effects object includes:
[0143] Determine the object model of the special effect object, and obtain the occlusion model corresponding to the special effect object based on the object model.
[0144] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 2, further comprising:
[0145] Optionally, determining the occlusion model corresponding to the special effects object includes:
[0146] An occlusion model corresponding to the special effect object is generated based on multiple edge points of the object being applied.
[0147] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 4, which further includes:
[0148] Optionally, generating an occlusion model corresponding to the object based on multiple edge points of the object includes:
[0149] The screen of multiple edge points of the object being applied is mapped onto the near clipping plane of the camera to obtain a projection patch, and the occlusion model corresponding to the special effect object is determined based on the projection patch.
[0150] According to one or more embodiments of this disclosure, Example Six provides the method of Example Two or Example Five, further comprising:
[0151] Optionally, determining the virtualization model corresponding to the target object includes:
[0152] The occlusion model is enlarged to obtain a blurred model.
[0153] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 2, which further includes:
[0154] Optionally, determining the blurred rendering area of the effect object based on the blurred model and the occlusion model includes:
[0155] Determine the non-overlapping area between the blurred model and the occlusion model, and use the non-overlapping area as the blurred rendering area of the special effect object.
[0156] According to one or more embodiments of this disclosure, Example 8 provides the method of Example 2, which further includes:
[0157] Optionally, the blurring process for the blurred rendering area includes:
[0158] For the pixel to be blurred in the blurred rendering area, determine the first pixel value of the pixel to be blurred in the blurred model and the second pixel value of the pixel to be blurred in the effect object;
[0159] Based on the first pixel value and the second pixel value, the target pixel value of the pixel to be blurred is determined.
[0160] According to one or more embodiments of this disclosure, Example Nine provides the method of Example Eight, further comprising:
[0161] Optionally, before determining the first pixel value of the pixel to be blurred in the blurring model, the method further includes:
[0162] For each model pixel in the fuzzy model, the pixel value of the model pixel is determined based on the pixel value of the image pixel in the image to be processed that corresponds to the model pixel.
[0163] According to one or more embodiments of this disclosure, Example 10 provides the method of Example 8, which further includes:
[0164] Optionally, determining the target pixel value of the pixel to be blurred based on the first pixel value and the second pixel value includes:
[0165] Determine the transparency of the pixel to be blurred in the blurring model;
[0166] Based on the transparency, the first pixel value, and the second pixel value, the target pixel value of the pixel to be blurred is determined.
[0167] According to one or more embodiments of this disclosure, Example 11 provides the method of Example 10, which further includes:
[0168] Optionally, determining the transparency of the pixel to be blurred in the blurring model includes:
[0169] Determine the viewing information corresponding to the pixel to be blurred and the normal information at the pixel to be blurred in the blurring model;
[0170] The transparency of the pixel to be blurred in the blurring model is determined based on the line-of-sight information and normal information.
[0171] According to one or more embodiments of this disclosure, Example Twelve provides the method of Example Eleven, which further includes:
[0172] Optionally, determining the transparency of the pixel to be blurred in the blurring model based on the line-of-sight information and normal information includes:
[0173] The line-of-sight information and normal information are multiplied by a dot to obtain a fusion value, and the transparency of the pixel to be blurred in the blurring model is determined based on the fusion value.
[0174] According to one or more embodiments of this disclosure, Example Thirteen provides the method of Example Ten, which further includes:
[0175] Optionally, determining the transparency of the pixel to be blurred in the blurring model includes:
[0176] The transparency of the pixel to be blurred in the blurring model is determined based on the grayscale value corresponding to the pixel to be blurred in the blurring model.
[0177] According to one or more embodiments of this disclosure, [Example Fourteen] provides a special effects processing apparatus, including:
[0178] The special effects triggering module is used to respond to the special effects addition operation by obtaining the image to be processed and the special effects object to be added;
[0179] The blurred region determination module is used to determine the blurred rendering region of the special effect object based on the special effect object and the special effect object when the image to be processed includes an object corresponding to the special effect object.
[0180] The special effects display module is used to blur the blurred rendering area, apply the blurred special effects object to the applied object to obtain a special effects image, and display the special effects image.
[0181] 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.
[0182] 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.
[0183] 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 special effects processing method, characterized in that, include: In response to the effect addition operation, obtain the image to be processed and the effect object to be added; When the image to be processed includes an object corresponding to the special effect object, based on the screen coordinates of multiple edge points of the object on the display screen and the size ratio between the near clipping plane in model space and the display screen, multiple mapping points corresponding to the multiple edge points on the near clipping plane are determined. These mapping points are then used as vertices for rendering to obtain projection patches corresponding to the edge points. An occlusion model corresponding to the special effect object is determined based on these projection patches. The near clipping plane is a pre-set clipping plane in model space. The occlusion model is used to occlude the area of the special effect object that is occluded by the object. A blurring model corresponding to the object being applied is determined, and the blurring rendering area of the special effect object is determined based on the blurring model and the occlusion model; wherein, the blurring rendering area is the entire area or part of the area of the special effect object; The blurred rendering area is blurred, and the blurred special effect object is applied to the applied object to obtain the special effect image, and the special effect image is displayed.
2. The special effects processing method according to claim 1, characterized in that, The process of determining the occlusion model corresponding to the special effects object includes: Determine the object model of the special effect object, and obtain the occlusion model corresponding to the special effect object based on the object model.
3. The special effects processing method according to claim 1, characterized in that, The determination of the virtualization model corresponding to the target object includes: The occlusion model is enlarged to obtain a blurred model.
4. The special effects processing method according to claim 1, characterized in that, Determining the blurred rendering area of the special effects object based on the blurred model and the occlusion model includes: Determine the non-overlapping area between the blurred model and the occlusion model, and use the non-overlapping area as the blurred rendering area of the effect object.
5. The special effects processing method according to claim 1, characterized in that, The process of blurring the rendered area includes: For the pixel to be blurred in the blurred rendering area, determine the first pixel value of the pixel to be blurred in the blurred model and the second pixel value of the pixel to be blurred in the effect object; Based on the first pixel value and the second pixel value, the target pixel value of the pixel to be blurred is determined.
6. The special effects processing method according to claim 5, characterized in that, Before determining the first pixel value of the pixel to be blurred in the blurring model, the method further includes: For each model pixel in the fuzzy model, the pixel value of the model pixel is determined based on the pixel value of the image pixel in the image to be processed that corresponds to the model pixel.
7. The special effects processing method according to claim 5, characterized in that, Determining the target pixel value of the pixel to be blurred based on the first pixel value and the second pixel value includes: Determine the transparency of the pixel to be blurred in the blurring model; Based on the transparency, the first pixel value, and the second pixel value, the target pixel value of the pixel to be blurred is determined.
8. The special effects processing method according to claim 7, characterized in that, Determining the transparency of the pixel to be blurred in the blurring model includes: Determine the viewing information corresponding to the pixel to be blurred and the normal information at the pixel to be blurred in the blurring model; The transparency of the pixel to be blurred in the blurring model is determined based on the line-of-sight information and normal information.
9. The special effects processing method according to claim 8, characterized in that, Determining the transparency of the pixel to be blurred in the blurring model based on the line-of-sight information and normal information includes: The line-of-sight information and normal information are multiplied by a dot to obtain a fusion value, and the transparency of the pixel to be blurred in the blurring model is determined based on the fusion value.
10. The special effects processing method according to claim 7, characterized in that, Determining the transparency of the pixel to be blurred in the blurring model includes: The transparency of the pixel to be blurred in the blurring model is determined based on the grayscale value corresponding to the pixel to be blurred in the blurring model.
11. A special effects processing device, characterized in that, include: The special effects triggering module is used to respond to the special effects addition operation by obtaining the image to be processed and the special effects object to be added; The blurred region determination module includes an occlusion model determination unit and a blurred region determination unit. The occlusion model determination unit is used to determine, when the image to be processed includes an object corresponding to the special effect object, multiple mapping points corresponding to the multiple edge points on the display screen based on the screen coordinates of multiple edge points of the object and the size ratio between the near clipping plane in model space and the display screen. These mapping points are then used as vertices for rendering to obtain projection patches corresponding to the edge points. An occlusion model corresponding to the special effect object is determined based on the projection patches. The near clipping plane is a pre-set clipping plane in model space. The occlusion model is used to occlude the area of the special effect object occluded by the object. The blurred region determination unit is used to determine the blurred model corresponding to the object and to determine the blurred rendering region of the special effect object based on the blurred model and the occlusion model. The special effects display module is used to blur the blurred rendering area, apply the blurred special effects object to the applied object to obtain a special effects image, and display the special effects image.
12. 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 special effects processing method as described in any one of claims 1-10.
13. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the special effects processing method as described in any one of claims 1-10.
Citation Information
Patent Citations
Image blurring method and device, storage medium and electronic device
CN110009555A
Image processing method and device, equipment and storage medium
CN113240692A
Image processing method and device, electronic equipment and storage medium
CN115272145A
Video determination method and device, electronic equipment and storage medium
CN115297271A
Image rendering method and device, electronic equipment and storage medium
CN115330925A