Art special effect processing method and device, electronic equipment and storage medium
By creating and adjusting the ballistic shape map in movie special effects production, building a three-dimensional ballistic model, and integrating it with the ballistic trajectory model, the problems of cumbersome and low efficiency in the existing technology are solved, and more efficient and realistic special effects production effects are achieved.
Patent Information
- Application Number
- CN202411853498.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
AI Technical Summary
When producing movie special effects, especially gunfire effects, the existing technology has problems such as cumbersome process and low production efficiency, resulting in inconsistent special effects and difficult to process.
By creating a ballistic shape diagram for the gun in the target lens screen, obtain the adjustment parameters and adjust the ballistic shape diagram, build a three-dimensional ballistic model, and fuse it with the ballistic trajectory model to generate a ballistic effect diagram. Then obtain the adaptive gun fire rendering, superimpose it on the target lens screen, and generate an art special effect screen.
Through the process-based production process, the efficiency of special effects production is improved, the authenticity and three-dimensionality of special effects are improved, and the unity of visual effects is ensured.
Smart Images

Figure CN119810273A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of special effect processing, and in particular to a method for processing art special effects, a device for processing art special effects, an electronic device and a computer-readable storage medium. Background Art
[0002] In live-action film projects, there are usually some special effects shots of actors firing guns. During the filming process, the crew usually uses prop model guns to shoot the shots. At the same time, for safety reasons, the prop guns on the shooting scene usually do not have the effect of firing ammunition. Therefore, in the post-production process, special effects producers are required to add corresponding gunfire effects and gunfire interaction effects according to the screen shots. However, in the production process, it is too dependent on the production experience of special effects producers. Not only are the production effects uneven, but the visual effects of art special effects are not highly unified and cannot be streamlined. If you are not satisfied with the ballistic effect, the corresponding special effects adjustment and rendering process are too complicated, which seriously affects the production efficiency of art special effects. Summary of the invention
[0003] The embodiments of the present invention provide a method, device, electronic device and computer-readable storage medium for processing art special effects, so as to solve or partially solve the problems of complicated procedures and low production efficiency in the production process of art special effects.
[0004] The embodiment of the present invention discloses a method for processing artistic special effects, comprising:
[0005] Create a ballistic shape map for the firearm in the target camera frame;
[0006] Acquiring adjustment parameters for the trajectory shape diagram, adjusting the trajectory shape diagram according to the adjustment parameters, and obtaining a three-dimensional trajectory model corresponding to the trajectory shape diagram;
[0007] In response to a ballistic trajectory model creation operation for the three-dimensional ballistic model, a ballistic trajectory model corresponding to the three-dimensional ballistic model is determined, and the three-dimensional ballistic model is merged with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens picture;
[0008] The embodiment of the present invention further discloses a processing device for artistic special effects, including:
[0009] A graphics creation module, used to create a ballistic shape diagram for the firearm in the target lens picture;
[0010] A trajectory model building module, used to obtain adjustment parameters for the trajectory shape diagram, adjust the trajectory shape diagram according to the adjustment parameters, and obtain a three-dimensional trajectory model corresponding to the trajectory shape diagram;
[0011] A ballistic trajectory model building module, configured to, in response to a ballistic trajectory model creation operation for the three-dimensional ballistic model, determine a ballistic trajectory model corresponding to the three-dimensional ballistic model, and fuse the three-dimensional ballistic model with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens picture;
[0012] The special effects processing module is used to obtain a gunfire effect diagram that is compatible with the ballistic effect diagram, and to superimpose the gunfire effect diagram and the ballistic effect diagram onto the target lens picture to obtain an art special effects picture corresponding to the target lens picture.
[0013] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0014] The memory is used to store computer programs;
[0015] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0016] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.
[0017] The embodiments of the present invention include the following advantages:
[0018] In an embodiment of the present invention, when adding corresponding art special effects to a corresponding picture, a ballistic shape diagram for a firearm in a target lens picture can be created, and then adjustment parameters for the ballistic shape diagram are obtained, and the ballistic shape diagram is adjusted according to the adjustment parameters to obtain a three-dimensional ballistic model corresponding to the ballistic shape diagram, and then in response to a ballistic trajectory model creation operation for the three-dimensional ballistic model, a ballistic trajectory model corresponding to the three-dimensional ballistic model is determined, and the three-dimensional ballistic model is merged with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens picture, and finally a gunfire effect diagram adapted to the ballistic effect diagram is obtained, and the gunfire effect diagram and the ballistic effect diagram are superimposed on the target lens picture to obtain an art special effects picture corresponding to the target lens picture, so that the production efficiency of special effects can be effectively improved through a streamlined production process, and at the same time, by constructing corresponding gunfire materials to simulate corresponding firing effects, the authenticity of special effects is improved, and the three-dimensional sense of gunfire ballistic effects is improved based on the image processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1is a flowchart of a method for processing artistic special effects provided in an embodiment of the present invention;
[0020] Figure 2 is a schematic diagram of a trajectory shape diagram provided in an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of a gradient mask provided in an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of a mask image provided in an embodiment of the present invention;
[0023] Figure 5 is a schematic diagram of a two-dimensional ballistic image provided in an embodiment of the present invention;
[0024] Figure 6 is a schematic diagram of a target image provided in an embodiment of the present invention;
[0025] Figure 7 is a schematic diagram of a three-dimensional trajectory model provided in an embodiment of the present invention;
[0026] Figure 8 is a schematic diagram of manufacturing a ballistic trajectory model provided in an embodiment of the present invention;
[0027] Fig. 9 It is a schematic diagram of making a trajectory effect diagram provided in an embodiment of the present invention;
[0028] Fig.10 is a schematic diagram of producing artistic special effects provided in an embodiment of the present invention;
[0029] Fig.11 is a schematic diagram of producing artistic special effects provided in an embodiment of the present invention;
[0030] Fig.12 is a schematic diagram of producing artistic special effects provided in an embodiment of the present invention;
[0031] Fig.13 It is a structural block diagram of a device for processing artistic special effects provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] As an example, when adding corresponding gunfire effects to the screen, the ballistic perspective depends more on the experience of the production staff. For lenses with large camera perspective, the perspective effect is difficult to grasp. Moreover, for multiple lenses in a scene, it is difficult to ensure uniformity in visual effects, and the overall production process cannot be streamlined, which seriously affects production efficiency. In addition, in image production software, the degree of realism of gunfire effects is often less accurate than that of real-life two-dimensional materials, and if special effects adjustments are required in the subsequent production process, they need to be returned to the image production software for processing, and the process is repeatedly modified, further affecting production efficiency.
[0034] In this regard, in the present invention, when adding corresponding art special effects to the corresponding picture, a ballistic shape diagram for the firearm in the target lens picture can be created, and then adjustment parameters for the ballistic shape diagram are obtained, and the ballistic shape diagram is adjusted according to the adjustment parameters to obtain a three-dimensional ballistic model corresponding to the ballistic shape diagram, and then in response to a ballistic trajectory model creation operation for the three-dimensional ballistic model, a ballistic trajectory model corresponding to the three-dimensional ballistic model is determined, and the three-dimensional ballistic model is merged with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens picture, and finally a gunfire effect diagram adapted to the ballistic effect diagram is obtained, and the gunfire effect diagram and the ballistic effect diagram are superimposed on the target lens picture to obtain an art special effects picture corresponding to the target lens picture, so that the production efficiency of special effects can be effectively improved through a streamlined production process, and at the same time, by constructing corresponding gunfire materials to simulate corresponding firing effects, the authenticity of special effects is improved, and the three-dimensional sense of gunfire ballistic effects is improved based on the image processing process.
[0035] Reference Figure 1 , shows a flowchart of a method for processing artistic special effects provided in an embodiment of the present invention, which may specifically include the following steps:
[0036] Step 101, creating a trajectory shape diagram for the firearm in the target lens picture;
[0037] Optionally, embodiments of the present invention may be applied to visual effects software (hereinafter referred to as software), and production personnel may add corresponding visual effects to corresponding images in the visual effects software, such as adding corresponding gunfire effects to guns in movie shots, etc. The present invention is not limited to this.
[0038] In an embodiment of the present invention, the production personnel can import corresponding material data into the software. The material data may include target lens pictures, etc. The target lens pictures may be the required pictures taken by the camera. The production personnel can add corresponding art effects to the target lens pictures to enhance the visual experience and realism of the pictures, etc. For example, for lens pictures with firearms, since a firearm model may be used for shooting during the shooting process, there is a lack of corresponding realism. Therefore, the production personnel can add corresponding gunfire special effects to the firearms in the lens pictures to enhance the realism of the lens pictures.
[0039] It should be noted that the material data may also include two-dimensional special effects materials and camera files, etc. The two-dimensional special effects materials may be special effects materials corresponding to the art special effects that need to be added. For example, when it is necessary to add gunfire special effects, the two-dimensional special effects materials may be two-dimensional gunfire materials, etc. The camera files may be the production content corresponding to the tracking group in the film and television production process, that is, the parameters obtained by tracking the camera according to the pictures taken by the director, such as camera parameters and motion trajectory, etc. The camera parameters may include information such as focal length, aperture, and lens distortion, and the present invention is not limited to this.
[0040] In the process of producing corresponding art effects, corresponding two-dimensional material images can be created according to the needs of art effects. For example, corresponding two-dimensional material images can be created according to the shape of an object, the movement trajectory of an object, etc. In one example, in the process of producing gunfire effects for a gun in a target lens image, the production staff can create a ballistic shape diagram in the software to represent the bullet's flight trajectory, so as to construct the corresponding ballistic special effects through the ballistic shape diagram. For example, Figure 2 As shown, a schematic diagram of a trajectory shape diagram provided in an embodiment of the present invention is shown. Production personnel can draw the trajectory shape diagram in the software to produce corresponding trajectory special effects.
[0041] Step 102, obtaining adjustment parameters for the trajectory shape graph, adjusting the trajectory shape graph according to the adjustment parameters, and obtaining a three-dimensional trajectory model corresponding to the trajectory shape graph;
[0042] In the embodiment of the present invention, after the corresponding trajectory shape diagram is created, the production personnel can also input adjustment parameters for the target image and adjust the target image to obtain the corresponding three-dimensional trajectory model.
[0043] Among them, the adjustment parameters at least include a gradient mask, a blur parameter and a first transformation parameter. The gradient mask can be used to perform a mask operation on the ballistic shape graph to obtain a mask image corresponding to the ballistic shape graph, and then the blur parameter can be used to perform a blur operation on the mask image to obtain a two-dimensional ballistic image corresponding to the mask image. Then, the first transformation parameter can be used to perform a three-dimensional construction of the two-dimensional ballistic image to obtain a three-dimensional ballistic model corresponding to the ballistic shape graph. After the corresponding two-dimensional graphics are constructed and the two-dimensional graphics are adjusted to the corresponding two-dimensional ballistic image by adjusting the parameters, the two-dimensional ballistic image is converted into a three-dimensional ballistic model based on the first transformation parameter, which effectively enriches the ballistic effect and enhances the three-dimensional sense of the ballistic effect.
[0044] It should be noted that the gradient mask can be a transition effect from transparent to opaque or from opaque to transparent, and can be used to control the transparency of the image. The transparency of the ballistic shape image can be controlled by the gradient mask; the generated mask image is blurred using the blur parameter. The blur parameter can control the degree and range of blur, making the edge of the image softer, so that after the blur operation, the mask image will become smoother, forming a two-dimensional ballistic image.
[0045] In one example, referring to Figure 3 , shows a schematic diagram of a gradient mask provided in an embodiment of the present invention. The production personnel can create a black-bordered gradient mask, and perform a mask operation on the trajectory shape diagram according to the gradient mask to obtain a gradient mask. Figure 4 Then, the production staff can further input the fuzzy parameters for the mask image, and perform fuzzy operation on the mask image through the fuzzy parameters to obtain the following: Figure 5 The two-dimensional ballistic image shown can be used as the basis for building a three-dimensional model.
[0046] Furthermore, after obtaining the two-dimensional ballistic image, the two-dimensional ballistic image can be converted into a three-dimensional ballistic model. Specifically, the first transformation parameter includes at least the number of replications and the first rotation parameter. In the process of converting the two-dimensional ballistic image into the three-dimensional ballistic model, a basic card object for the two-dimensional ballistic image can be created, and then the two-dimensional ballistic image is adsorbed onto the basic card object to obtain a target image. The target image is then replicated according to the number of replications, and after each replication is completed, the replicated target image is rotated according to the first rotation parameter, and the rotated target images are combined with the original target image to obtain a three-dimensional ballistic model corresponding to the ballistic shape diagram, thereby effectively enriching the ballistic effect and enhancing the three-dimensional sense of the ballistic effect.
[0047] It should be noted that the basic card object can be a rectangle with a corresponding size. The size of the basic card object is close to the size of the two-dimensional ballistic image. In the process of creating the basic card object, the size of the two-dimensional ballistic image can be obtained, and then the corresponding basic card object can be constructed with the size, and then the two-dimensional ballistic image is adsorbed onto the basic card object to obtain the target image. For the target image, the production staff can set the corresponding number of copies and rotation parameters. For example, the number of copies can be 6 times, and the rotation parameter can be 30 degrees. Then, the target image can be copied first, and the image obtained by the first copy can be rotated 30 degrees along the corresponding axis. Then, the target image can be copied for the second time, and the image obtained by the second copy can be rotated 60 degrees along the corresponding axis, and so on, until it is copied 6 times, and then the corresponding three-dimensional ballistic model is constructed based on the obtained images.
[0048] For example, refer to Figure 6 , shows a schematic diagram of a target image provided in an embodiment of the present invention. The rectangular area is the basic card object. After the basic card object is created, the trajectory shape image can be adsorbed on the basic card object to construct the corresponding target image. The target image can be copied and rotated to obtain Figure 7 The three-dimensional ballistic model shown in FIG. 1 effectively enriches the ballistic effect and enhances the three-dimensional sense of the ballistic effect. Figure 6 The basic card object shown contains several rectangles. The number of rectangles is used to adjust the size of the basic card object. For example, a basic card object of size 3*3 can be composed of 9 rectangles. By adjusting the number of rectangles, the size of the basic card object and the trajectory shape diagram can be kept consistent.
[0049] Step 103, in response to the ballistic trajectory model creation operation for the three-dimensional ballistic model, determining a ballistic trajectory model corresponding to the three-dimensional ballistic model, and fusing the three-dimensional ballistic model with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens picture;
[0050] While constructing the corresponding three-dimensional ballistic model, a ballistic trajectory model corresponding to the three-dimensional ballistic model can also be constructed. By determining the ballistic trajectory model corresponding to the ballistic shape diagram and fusing the three-dimensional ballistic model with the ballistic trajectory model, a ballistic rendering for the target lens picture is obtained. Thus, by constructing the corresponding ballistic rendering when the firearm is fired, corresponding gunfire special effects can be added to the target lens picture based on the ballistic rendering, thereby improving the visual effect of the lens picture.
[0051] The trajectory model creation operation at least includes a model creation operation and a model adjustment operation, etc. The model creation operation may be to create a corresponding three-dimensional model, and the model adjustment operation may be to adjust the created three-dimensional model. Specifically, by responding to the model creation operation for the three-dimensional trajectory model, a stereoscopic model adapted to the three-dimensional trajectory model is created, and a target map for the stereoscopic model is obtained, and then the target map is adsorbed onto the stereoscopic model to construct a corresponding target model, and then in response to the model adjustment operation for the target model, a second transformation parameter corresponding to the model adjustment operation is determined, and the target model is morphologically adjusted according to the second transformation parameter to obtain a trajectory model corresponding to the three-dimensional trajectory model. The target map may be a preset image, such as a checkerboard map, etc., and the present invention is not limited to this.
[0052] It should be noted that the three-dimensional model can be equivalent to the "moving channel" corresponding to the bullet. In a specific implementation, the second transformation parameter includes at least a rotation parameter and a size parameter. The target model can be rotated according to the rotation parameter, and the size of the target model can be adjusted according to the size parameter after rotation to obtain a ballistic trajectory model corresponding to the three-dimensional ballistic model. After constructing the corresponding three-dimensional model, by adjusting its corresponding direction and size, etc., it can be matched with the size and moving direction of the bullet, thereby simulating the corresponding moving trajectory of the bullet after being fired from a firearm.
[0053] For example, refer to Figure 8 , shows a schematic diagram of making a ballistic trajectory model provided in an embodiment of the present invention. The production personnel can create a cylinder ① in the software, and connect the cylinder to the corresponding checkerboard map to obtain the corresponding target model. Then the production personnel can input the size parameters and rotation parameters for the target model, and then adjust the target model according to the input size parameters and rotation parameters, so as to obtain the corresponding ballistic trajectory model ②. It should be noted that the rotation parameter can be used to adjust the size of the target model relative to the target axis (such as the x-axis, y-axis, and z-axis, etc.), and the target model is rotated by the rotation parameter to match the moving trajectory of the bullet fired by the firearm in the target lens picture, thereby improving the authenticity of the lens picture.
[0054] Furthermore, after constructing the corresponding ballistic trajectory model, the three-dimensional ballistic model can be integrated with the ballistic trajectory model to obtain a ballistic rendering for the target lens image. Specifically, the camera file corresponding to the target lens image can be obtained first, and then each pixel in the three-dimensional ballistic model can be scanned to obtain the color value corresponding to the pixel, and the color value corresponding to each pixel is assigned to the ballistic trajectory model, and the ballistic trajectory model with assigned color is connected to the camera file to obtain the ballistic rendering for the target lens image. After constructing the corresponding ballistic trajectory model and the three-dimensional ballistic model, they are aligned with the camera file to inversely seek the correct perspective performance of the ballistic trajectory model under the camera perspective, so that the movement of the ballistic trajectory model is consistent with the camera movement of the actual shot image, further improving the authenticity of the lens image.
[0055] In one example, a production staff may produce a corresponding trajectory effect diagram in a 3D modeling software, and the relevant process may include:
[0056] 1. Construct a three-dimensional ballistic model:
[0057] In 3D modeling software, create a ballistic model. You can use curve tools (such as NURBS curves, Bezier curves) to define the path of the trajectory, and then generate corresponding geometric bodies (such as Tube, Cylinder, etc.).
[0058] Add materials and textures to the ballistic model to enhance the visual effect.
[0059] 2. Import the 3D ballistic model into the 3D modeling software:
[0060] Export the constructed 3D ballistic model to FBX or OBJ format, etc.
[0061] In 3D modeling software, you can use the Scene node to import FBX or OBJ files. The Scene node allows you to load 3D models and integrate them into Nuke's 3D scene.
[0062] 3. Connect the 3D ballistic model with the ballistic trajectory model:
[0063] Connect the 3D ballistic model in the Scene node to the "Input" port of the ScanlineRender node.
[0064] Connect the ballistic trajectory model (the processed 3D Cylinder object) to the "Input" port of the ScanlineRender node. In this way, the ScanlineRender node will render the 3D ballistic model and the ballistic trajectory model at the same time.
[0065] 4. Adjust the synthesis effect:
[0066] Camera settings: In the property panel of the ScanlineRender node, set a suitable camera perspective to ensure that the 3D ballistic model and ballistic trajectory model have the correct perspective effect when rendering.
[0067] Lighting settings: Add light sources (such as PointLight or SpotLight) and adjust their parameters to illuminate the 3D ballistic model and ballistic trajectory model.
[0068] Materials and Textures: Adjust the materials and textures of the 3D ballistic model and ballistic trajectory model as needed to achieve the desired visual effect.
[0069] 5. Rendering output:
[0070] At the output of the ScanlineRender node, use a Viewer node to view the final composite effect.
[0071] If you are satisfied, you can render the result and export it to the desired format.
[0072] Furthermore, for the above process, the corresponding underlying implementation process may be:
[0073] 1. 3D scene rendering:
[0074] Geometry processing: The ScanlineRender node processes 3D geometry in the 3D ballistic model and ballistic trajectory model, and calculates its vertex positions, normals, UV coordinates, etc.
[0075] Camera Projection: Use the set camera view to project the vertices of the 3D geometry from 3D space to 2D screen space.
[0076] Rasterization: Rasterize the projected 2D geometry and calculate the coverage of each pixel on the geometry.
[0077] Lighting calculation: Calculate the lighting effect of each pixel based on the set light source and material properties.
[0078] 2. 2D image synthesis:
[0079] Blending Mode: The ScanlineRender node blends the rendered 3D ballistic model with the ballistic trajectory model. By default, the 3D scene will overlay the background image, but the compositing effect can be controlled by adjusting the blending mode (such as Alpha channel, Z depth, etc.).
[0080] Alpha channel processing: If there are transparent or semi-transparent parts in the 3D scene, ScanlineRender will process the Alpha channel to ensure that the transparent effect is synthesized correctly.
[0081] 3. Final output:
[0082] Pixel blending: At each pixel location, the ScanlineRender node determines the final output color value based on the depth information and blending mode.
[0083] Output Image: The final composited image is output to the output port of the ScanlineRender node, which can be viewed in the Viewer node, or further processed and rendered.
[0084] For example, assuming that the ballistic trajectory model is a cylinder, after the production staff constructs the corresponding three-dimensional ballistic model, since both are models of three-dimensional structures, they can first traverse the vertex positions corresponding to each vertex on the ballistic trajectory model and the three-dimensional ballistic model, and map them to the corresponding 2D space. Since the size of the ballistic trajectory model and the three-dimensional ballistic model can be consistent, after mapping to the 2D space, one of the pixels can be used as a reference point to establish a one-to-one correspondence between the first pixel point in the ballistic trajectory model and the second pixel point in the three-dimensional ballistic model. Then, based on the constructed correspondence, the color value of the second pixel point in the three-dimensional ballistic model is assigned to the first pixel point. After the color value is assigned, it can be remapped to the 3D space, thereby completing the connection between the ballistic trajectory model and the three-dimensional ballistic model and obtaining a ballistic rendering.
[0085] Among them, the camera file at least includes the camera parameters and motion trajectory obtained by motion tracking the camera shooting the target lens picture, and the ballistic trajectory model with color is connected by perspective according to the camera parameters and motion trajectory to obtain the ballistic effect diagram for the target lens picture, thereby ensuring that the position, angle and perspective relationship of the ballistic trajectory model in the three-dimensional space are consistent with the actual shot picture, thereby improving the authenticity of the lens picture.
[0086] In one example, referring to Fig. 9, shows a schematic diagram of producing a ballistic effect diagram provided in an embodiment of the present invention. The camera file may include motion trajectory information and camera parameters corresponding to the camera during shooting, the motion trajectory information at least includes position information, rotation information and scaling information, and the camera parameters at least include focal length, aperture, sensor size and lens distortion parameters, etc. In the process of connecting the ballistic trajectory model with the camera file, a corresponding virtual camera ① can be first created in a three-dimensional space based on the camera motion trajectory and camera parameters, and then the perspective relationship of the ballistic trajectory model ② in the same three-dimensional space can be adjusted according to the motion trajectory information and camera parameters, such as adjusting the position of the ballistic trajectory model in the three-dimensional space according to the position information, adjusting the rotation of the ballistic trajectory model in the three-dimensional space according to the rotation information, and adjusting the scaling ratio of the ballistic trajectory model in the three-dimensional space according to the scaling information, so that the perspective relationship of the ballistic trajectory model is consistent with the actual shot picture, thereby improving the authenticity of the lens picture.
[0087] For example, assuming that the camera position in the camera file is (10, 20, 30), the position of the trajectory model should also be set to (10, 20, 30); the camera rotation in the camera file is (30°, 45°, 60°), the rotation of the trajectory model should also be set to (30°, 45°, 60°); assuming that the focal length in the camera file is 50mm and the sensor size is 36mmx24mm, the scaling ratio of the trajectory model should be adjusted according to these parameters; assuming that the focal length in the camera file is 50mm, the focal length of the virtual camera should also be set to 50mm, and the field of view angle is calculated based on the focal length and sensor size, and the field of view angle of the virtual camera is ensured to be consistent with the real camera, so that the movement of the trajectory model is consistent with the camera movement of the real shot, thereby improving the authenticity of the lens image.
[0088] Step 104, obtaining a gunfire effect diagram that matches the ballistic effect diagram, and superimposing the gunfire effect diagram and the ballistic effect diagram on the target lens picture to obtain an art special effect picture corresponding to the target lens picture.
[0089] In an embodiment of the present invention, after constructing a corresponding ballistic effect graph, the ballistic effect graph can be used for the corresponding moving trajectory of the bullet after the firearm fires the bullet, and corresponding gunfire can also appear after the firearm is fired. For this, a gunfire effect graph adapted to the ballistic effect graph can also be obtained, and the gunfire effect graph can be a corresponding two-dimensional material image. Then, the constructed gunfire effect graph, the ballistic effect graph and the target lens picture are fused, and the gunfire effect graph and the ballistic effect graph are superimposed on the target lens picture to obtain the art special effects picture corresponding to the target lens picture, so that the production efficiency of the special effects can be effectively improved through a streamlined production process. At the same time, by constructing corresponding gunfire materials to simulate the corresponding firing effects, the authenticity of the special effects is improved, and the three-dimensional sense of the gunfire ballistic effect is improved based on the image processing process.
[0090] Furthermore, in order to ensure the compatibility between the ballistic effect diagram and the muzzle of the firearm in the target lens picture, the corresponding positions of the gunfire effect diagram and the ballistic effect diagram can also be adjusted. For example, in response to the adjustment operation on the ballistic effect diagram, a third transformation parameter corresponding to the adjustment operation can be obtained, and the position of the ballistic effect diagram in the target lens picture can be adjusted according to the third transformation parameter. Among them, the third transformation parameter at least includes a displacement parameter and a second rotation parameter, the displacement parameter can be coordinate information composed of a horizontal coordinate and a vertical coordinate, and the second rotation parameter can be a rotation angle in a plane, etc., and the position of the ballistic effect diagram in the target lens picture can be adjusted according to the displacement parameter and the second rotation parameter.
[0091] It should be noted that when the ballistic effect diagram is connected to the target lens screen, the display status of the ballistic effect diagram in the target lens screen can be adjusted by the production staff at different processing stages. For example, before the ballistic trajectory model and the three-dimensional ballistic model are connected, the ballistic trajectory model can be superimposed on the target lens screen, and the corresponding position and size of the ballistic trajectory model can be adjusted. For example, by responding to the adjustment operation on the ballistic trajectory model, the fourth transformation parameter corresponding to the adjustment operation is obtained, and the position of the ballistic trajectory model in the target lens screen is adjusted according to the fourth transformation parameter. Therefore, before the ballistic trajectory model and the three-dimensional ballistic model are connected, the production staff can first connect the ballistic trajectory model with the target lens screen and adjust the corresponding position of the ballistic effect in the screen; the production staff can also connect the ballistic trajectory model with the three-dimensional ballistic model to obtain the ballistic effect diagram, and then superimpose the ballistic effect diagram on the target lens screen, and then adjust the position and size of the ballistic effect diagram. The present invention is not limited to this.
[0092] In addition, for the gunfire effect map, the adjustment process is similar to that of the ballistic effect map, which will not be repeated here. By adjusting the corresponding positions and directions of the gunfire effect map and the ballistic effect map, they are adapted to the picture content of the target lens picture, thereby improving the consistency between the art special effects and the picture content, thereby improving the realism of the picture and ensuring the visual effect.
[0093] In one example, referring to Fig.10 , shows a schematic diagram of producing art special effects provided in an embodiment of the present invention, wherein, after producing a corresponding ballistic effect graph 1010 and obtaining a corresponding gunfire effect graph 1020, the two can be superimposed on the lens picture. At the same time, the production personnel can adjust the corresponding positions of the ballistic effect graph 1010 and the gunfire effect graph 1020 according to the muzzle position of the gun in the lens picture, such as Fig.11 , Fig.12 The visual effects displayed can be effectively improved through the streamlined production process, and the corresponding firing effects can be simulated by constructing corresponding gunfire materials to improve the authenticity of the special effects. The image processing process can also improve the three-dimensional sense of the gunfire trajectory effect.
[0094] In addition, for the ballistic trajectory model involved in the above embodiments, the corresponding trajectory length can always remain unchanged. At the same time, the final performance of the trajectory can show different effects according to the camera angle, lens perspective relationship, etc. For example, when the muzzle of the gun in the lens picture is facing the camera, the trajectory is manifested as a point; if the direction of the camera is perpendicular to the moving direction of the bullet, the trajectory is a fixed length. In addition, when the direction forms a certain angle with the moving direction of the bullet, the corresponding ballistic effect diagram can be adjusted according to the corresponding angle. The corresponding process can refer to the process of connecting the ballistic trajectory model with the camera file in the aforementioned embodiment, and the present invention will not be repeated here.
[0095] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It is understandable that those skilled in the art can also make settings according to actual needs under the guidance of the ideas of the embodiments of the present invention, and the present invention is not limited to this.
[0096] In an embodiment of the present invention, when adding corresponding art special effects to a corresponding picture, a ballistic shape diagram for a firearm in a target lens picture can be created, and then adjustment parameters for the ballistic shape diagram are obtained, and the ballistic shape diagram is adjusted according to the adjustment parameters to obtain a three-dimensional ballistic model corresponding to the ballistic shape diagram, and then in response to a ballistic trajectory model creation operation for the three-dimensional ballistic model, a ballistic trajectory model corresponding to the three-dimensional ballistic model is determined, and the three-dimensional ballistic model is merged with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens picture, and finally a gunfire effect diagram adapted to the ballistic effect diagram is obtained, and the gunfire effect diagram and the ballistic effect diagram are superimposed on the target lens picture to obtain an art special effects picture corresponding to the target lens picture, so that the production efficiency of special effects can be effectively improved through a streamlined production process, and at the same time, by constructing corresponding gunfire materials to simulate corresponding firing effects, the authenticity of special effects is improved, and the three-dimensional sense of gunfire ballistic effects is improved based on the image processing process.
[0097] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0098] Reference Fig.13 , shows a structural block diagram of a processing device for artistic special effects provided in an embodiment of the present invention, which may specifically include the following modules:
[0099] A graphics creation module 1301 is used to create a trajectory shape diagram for the firearm in the target lens picture;
[0100] The trajectory model building module 1302 is used to obtain adjustment parameters for the trajectory shape diagram, adjust the trajectory shape diagram according to the adjustment parameters, and obtain a three-dimensional trajectory model corresponding to the trajectory shape diagram;
[0101] A trajectory model building module 1303 is used to determine a trajectory model corresponding to the three-dimensional trajectory model in response to a trajectory model creation operation for the three-dimensional trajectory model, and fuse the three-dimensional trajectory model with the trajectory model to obtain a trajectory effect diagram for the target lens picture;
[0102] The special effect processing module 1304 is used to obtain a gunfire effect diagram that matches the ballistic effect diagram, and superimpose the gunfire effect diagram and the ballistic effect diagram on the target lens picture to obtain an art special effect picture corresponding to the target lens picture.
[0103] In some feasible implementations, the adjustment parameters at least include a gradient mask, a blur parameter, and a first transformation parameter, and the trajectory model construction module 1302 is specifically used to:
[0104] Using the gradient mask to perform a mask operation on the trajectory shape graph to obtain a mask image corresponding to the trajectory shape graph;
[0105] Performing a fuzzy operation on the mask image using the fuzzy parameters to obtain a two-dimensional ballistic image corresponding to the mask image;
[0106] The first transformation parameter is used to perform three-dimensional construction on the two-dimensional trajectory image to obtain a three-dimensional trajectory model corresponding to the trajectory shape diagram.
[0107] In some feasible implementations, the first transformation parameter includes at least the number of replications and a first rotation parameter, and the trajectory model building module 1302 is specifically used to:
[0108] Creating a base card object for the two-dimensional ballistic image;
[0109] Adsorbing the two-dimensional ballistic image onto the basic card object to obtain a target image;
[0110] The target image is copied according to the number of copies, and after each copy is completed, the copied target image is rotated according to the first rotation parameter, and each rotated target image is combined with the original target image to obtain a three-dimensional trajectory model corresponding to the trajectory shape diagram.
[0111] In some feasible implementations, the trajectory model creation operation includes at least a model creation operation and a model adjustment operation, and the trajectory model construction module 1303 is specifically used to:
[0112] In response to a model creation operation for the three-dimensional trajectory model, a stereo model for the three-dimensional trajectory model is created, and a target map for the stereo model is acquired;
[0113] Adsorbing the target map onto the three-dimensional model to construct a corresponding target model;
[0114] In response to a model adjustment operation on the target model, a second transformation parameter corresponding to the model adjustment operation is determined, and the target model is morphologically adjusted according to the second transformation parameter to obtain a ballistic trajectory model corresponding to the three-dimensional ballistic model.
[0115] In some feasible implementations, the second transformation parameter includes at least a rotation parameter and a size parameter, and the ballistic trajectory model construction module 1303 is specifically used to:
[0116] The target model is rotated according to the rotation parameter, and the size of the target model is adjusted according to the size parameter after the rotation, so as to obtain a ballistic trajectory model corresponding to the three-dimensional ballistic model.
[0117] In some feasible implementations, the ballistic trajectory model building module 1303 is specifically used to:
[0118] Obtaining a camera file corresponding to the target lens image;
[0119] Scan each pixel in the three-dimensional ballistic model to obtain the color value corresponding to the pixel, assign the color value corresponding to the pixel to the ballistic trajectory model, connect the ballistic trajectory model after assigning the color to the camera file, and obtain the ballistic effect diagram for the target lens picture.
[0120] In some feasible implementations, the camera file at least includes camera parameters and motion trajectories obtained by motion tracking the camera shooting the target lens image, and the ballistic trajectory model construction module 1303 is specifically used for:
[0121] The ballistic trajectory model after the color is assigned is connected by viewing angle according to the camera parameters and the motion trajectory to obtain a ballistic effect diagram for the target lens picture.
[0122] In some feasible implementations, the device further includes:
[0123] The image adjustment module is used to respond to the adjustment operation on the trajectory effect diagram, obtain the third transformation parameter corresponding to the adjustment operation, and adjust the position of the trajectory effect diagram in the target lens picture according to the third transformation parameter.
[0124] In some feasible implementations, the third transformation parameter includes at least a displacement parameter and a second rotation parameter, and the image adjustment module is specifically configured to:
[0125] The position of the trajectory effect diagram in the target lens image is adjusted according to the displacement parameter and the second rotation parameter.
[0126] Some possible implementations also include:
[0127] The trajectory model adjustment module is used to respond to the adjustment operation on the ballistic trajectory model, obtain the fourth transformation parameter corresponding to the adjustment operation, and adjust the position of the ballistic trajectory model in the target lens picture according to the fourth transformation parameter.
[0128] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0129] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, each process of the above-mentioned artistic special effects processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0130] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned method for processing art special effects is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0131] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0132] It should be understood by those skilled in the art that the embodiments of the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, EEPROM, Flash, and eMMC, etc.) containing computer-usable program codes.
[0133] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0136] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0137] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0138] The above is a detailed introduction to a method for processing art special effects and a device for processing art special effects provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for processing artistic special effects, characterized in that: include: Create a ballistic shape map for the firearm in the target camera frame; Acquiring adjustment parameters for the trajectory shape diagram, adjusting the trajectory shape diagram according to the adjustment parameters, and obtaining a three-dimensional trajectory model corresponding to the trajectory shape diagram; In response to a ballistic trajectory model creation operation for the three-dimensional ballistic model, a ballistic trajectory model corresponding to the three-dimensional ballistic model is determined, and the three-dimensional ballistic model is merged with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens picture; A gunfire effect diagram that matches the ballistic effect diagram is obtained, and the gunfire effect diagram and the ballistic effect diagram are superimposed on the target lens picture to obtain an art special effect picture corresponding to the target lens picture.
2. The method according to claim 1, characterized in that: The adjustment parameters at least include a gradient mask, a blur parameter, and a first transformation parameter, and the step of adjusting the trajectory shape graph according to the adjustment parameters to obtain a three-dimensional trajectory model corresponding to the trajectory shape graph includes: Using the gradient mask to perform a mask operation on the trajectory shape graph to obtain a mask image corresponding to the trajectory shape graph; Performing a fuzzy operation on the mask image using the fuzzy parameters to obtain a two-dimensional ballistic image corresponding to the mask image; The first transformation parameter is used to perform three-dimensional construction on the two-dimensional trajectory image to obtain a three-dimensional trajectory model corresponding to the trajectory shape diagram.
3. The method according to claim 2, characterized in that The first transformation parameters at least include the number of replications and the first rotation parameter, and the three-dimensional construction of the two-dimensional trajectory image using the first transformation parameters to obtain the three-dimensional trajectory model corresponding to the trajectory shape diagram includes: Creating a base card object for the two-dimensional ballistic image; Adsorbing the two-dimensional ballistic image onto the basic card object to obtain a target image; The target image is copied according to the number of copies, and after each copy is completed, the copied target image is rotated according to the first rotation parameter, and each rotated target image is combined with the original target image to obtain a three-dimensional trajectory model corresponding to the trajectory shape diagram.
4. The method according to claim 2 or 3, characterized in that: The ballistic trajectory model creation operation includes at least a model creation operation and a model adjustment operation. In response to the ballistic trajectory model creation operation for the three-dimensional ballistic model, determining a ballistic trajectory model corresponding to the three-dimensional ballistic model includes: In response to a model creation operation for the three-dimensional trajectory model, a stereo model for the three-dimensional trajectory model is created, and a target map for the stereo model is acquired; Adsorbing the target map onto the three-dimensional model to construct a corresponding target model; In response to a model adjustment operation on the target model, a second transformation parameter corresponding to the model adjustment operation is determined, and the target model is morphologically adjusted according to the second transformation parameter to obtain a ballistic trajectory model corresponding to the three-dimensional ballistic model.
5. The method according to claim 4, characterized in that The second transformation parameters at least include a rotation parameter and a size parameter, and the morphological adjustment of the target model according to the second transformation parameters to obtain a ballistic trajectory model corresponding to the three-dimensional ballistic model includes: The target model is rotated according to the rotation parameter, and the size of the target model is adjusted according to the size parameter after the rotation, so as to obtain a ballistic trajectory model corresponding to the three-dimensional ballistic model.
6. The method according to claim 1, characterized in that The step of fusing the three-dimensional ballistic model with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens image includes: Obtaining a camera file corresponding to the target lens image; Scan each pixel in the three-dimensional ballistic model to obtain the color value corresponding to the pixel, assign the color value corresponding to the pixel to the ballistic trajectory model, connect the ballistic trajectory model after assigning the color to the camera file, and obtain the ballistic effect diagram for the target lens picture.
7. The method according to claim 6, characterized in that The camera file at least includes camera parameters and motion trajectory obtained by motion tracking the camera shooting the target lens picture, and the ballistic trajectory model after coloring is connected with the camera file to obtain a ballistic effect diagram for the target lens picture, including: The ballistic trajectory model after the color is assigned is connected by viewing angle according to the camera parameters and the motion trajectory to obtain a ballistic effect diagram for the target lens picture.
8. The method according to claim 1, characterized in that: Also includes: In response to an adjustment operation on the trajectory effect diagram, a third transformation parameter corresponding to the adjustment operation is acquired, and a position of the trajectory effect diagram in the target lens picture is adjusted according to the third transformation parameter.
9. The method according to claim 8, characterized in that The third transformation parameter at least includes a displacement parameter and a second rotation parameter, and adjusting the position of the trajectory effect diagram in the target lens picture according to the third transformation parameter includes: The position of the trajectory effect diagram in the target lens image is adjusted according to the displacement parameter and the second rotation parameter.
10. The method according to claim 1, characterized in that Also includes: In response to an adjustment operation on the ballistic trajectory model, a fourth transformation parameter corresponding to the adjustment operation is acquired, and a position of the ballistic trajectory model in the target lens picture is adjusted according to the fourth transformation parameter.
11. A processing device for artistic special effects, characterized in that: include: A graphics creation module, used to create a ballistic shape diagram for the firearm in the target lens picture; A trajectory model building module, used to obtain adjustment parameters for the trajectory shape diagram, adjust the trajectory shape diagram according to the adjustment parameters, and obtain a three-dimensional trajectory model corresponding to the trajectory shape diagram; A ballistic trajectory model building module, configured to, in response to a ballistic trajectory model creation operation for the three-dimensional ballistic model, determine a ballistic trajectory model corresponding to the three-dimensional ballistic model, and fuse the three-dimensional ballistic model with the ballistic trajectory model to obtain a ballistic effect diagram for the target lens picture; The special effects processing module is used to obtain a gunfire effect diagram that is compatible with the ballistic effect diagram, and to superimpose the gunfire effect diagram and the ballistic effect diagram onto the target lens picture to obtain an art special effects picture corresponding to the target lens picture.
12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 10 when executing the program stored in the memory.
13. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 10.