Method and device for generating a motion-blurred image, electronic device and storage medium

By generating motion-blurred vector graphics and processing target images using vector blur nodes, the problems of low rendering efficiency and poor flexibility in existing technologies are solved, achieving efficient and flexible motion-blurred image generation.

CN115797395BActive Publication Date: 2026-05-01NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2022-11-03
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies suffer from low rendering efficiency and poor flexibility in generating motion-blurred images, and are particularly unsuitable for live-action video footage.

Method used

By generating a motion-blurred vector image to indicate the direction and extent of motion blur, and using vector blur nodes to process the target image, a motion-blurred image is generated.

Benefits of technology

It enables efficient and flexible generation of motion-blurred images with the desired effect, improving the efficiency and flexibility of motion-blurred image generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115797395B_ABST
    Figure CN115797395B_ABST
Patent Text Reader

Abstract

The application provides a motion blurred image generation method and device, electronic equipment and storage medium; wherein the method comprises: generating a motion blurred vector diagram of a target image; the motion blurred vector diagram is used to indicate a motion blurred direction and a motion blurred range; based on the motion blurred vector diagram, the target image is processed by a vector blur node to obtain a motion blurred image. In this way, by generating a motion blurred vector diagram containing a motion blurred direction and a motion blurred range, the motion blurred effect of the target image is controlled, and the motion blur is processed by a vector blur node, so that the motion blurred image with the expected effect can be generated flexibly and efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of special effects production technology, and in particular to a method, apparatus, electronic device, and storage medium for generating motion-blurred images. Background Technology

[0002] Motion blur is an important step in visual effects production. Motion blur refers to the blurred, dragging traces in an image caused by the movement of a subject. Besides cameras capturing motion blur, image processing techniques can also be used to create motion blur effects.

[0003] Current technologies for generating motion-blurred images typically involve directly rendering the motion blur in Digital Content Creation (DCC) software. However, this approach is not only inefficient but also poorly applicable to live-action video footage, exhibiting technical problems of low efficiency and poor flexibility. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and storage medium for generating motion-blurred images, so as to improve the efficiency and flexibility of motion-blurred image generation.

[0005] In a first aspect, embodiments of the present invention provide a method for generating a motion-blurred image, the method comprising: generating a motion-blurred vector image of a target image; the motion-blurred vector image being used to indicate the direction and range of motion blur; and, based on the motion-blurred vector image, performing motion blur processing on the target image through vector blur nodes to obtain a motion-blurred image.

[0006] Secondly, embodiments of the present invention provide a motion-blurred image generation apparatus, the apparatus comprising: a generation module for generating a motion-blurred vector image of a target image; the motion-blurred vector image is used to indicate the direction and range of motion blur; and a blurring module for performing motion blur processing on the target image based on the motion-blurred vector image through vector blur nodes to obtain a motion-blurred image.

[0007] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described method for generating motion-blurred images.

[0008] Fourthly, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above-described method for generating motion-blurred images.

[0009] The embodiments of the present invention bring the following beneficial effects:

[0010] The aforementioned method, apparatus, electronic device, and storage medium for generating motion-blurred images generate a motion-blurred vector image of a target image. The motion-blurred vector image indicates the direction and range of motion blur. Based on the motion-blurred vector image, motion blur processing is applied to the target image using vector blur nodes to obtain a motion-blurred image. In this method, by generating a motion-blurred vector image containing the direction and range of motion blur, the motion blur effect of the target image is controlled, and motion blur is processed using vector blur nodes, enabling flexible and efficient generation of motion-blurred images with the desired effect.

[0011] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0012] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0013] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0014] Figure 1 This is a flowchart of one embodiment of the method for generating motion-blurred images according to the present invention;

[0015] Figure 2 This is a flowchart of another embodiment of the method for generating motion-blurred images according to the present invention;

[0016] Figure 3 This is a schematic diagram of a method for generating motion-blurred images in an embodiment of the present invention;

[0017] Figure 4 This is another schematic diagram of the method for generating motion-blurred images in an embodiment of the present invention;

[0018] Figure 5 A schematic diagram of a motion-blurred image generation device provided in an embodiment of the present invention;

[0019] Figure 6This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the method for generating motion-blurred images in this invention includes:

[0022] Step S10: Generate a motion blur vector image of the target image; the motion blur vector image is used to indicate the direction and range of motion blur.

[0023] It should be noted that a motion-blurred vector image is an image file used to record motion vector information. It is an object-oriented image, also known as a motion-blurred vector map. The recorded motion vector refers to quantities with magnitude and direction. Motion-blurred vector images can be generated in any way, such as through special effects compositing software, graphics tools, DCC software, etc. Special effects compositing software includes, but is not limited to, software used to create video or image effects such as After Effects (AE), Nuke, and Fusion. As an example, and not a limitation, in one implementation, the motion-blurred vector image of the target image is generated using Nuke software. Further, the motion-blurred vector image of the target image is generated in Nuke using a preset expression.

[0024] In one implementation, the motion blur vector image of the target image can be generated based on an initial vector image that does not contain motion vector information, or it can be generated based on a target vector image that contains motion vector information. By way of example and not limitation, the target vector image containing motion vector information can be the motion blur vector image of the previous frame of the target image, the motion blur vector image of the previous keyframe of the target image, or the motion blur vector image of any image. Specifically, step S10 includes: generating the motion blur vector image of the target image based on the motion blur vector image of the previous frame of the target image; or, step S10 includes: generating the motion blur vector image of the target image based on the motion blur vector image of the previous keyframe of the target image; or, step S10 includes: generating the motion blur vector image of the target image based on the motion blur vector image of any image. The specific details are not limited here. It is understood that images in different frames within the same video file as the target image constitute an inter-frame relationship with the target image. That is, the previous frame image, the previous keyframe image, or other frame images of the target image are all in the same video file as the target image. The specific details are not limited here. The motion blur vector image of any image may not have a direct relationship with the target image. It can be a motion blur vector image of an image with a similar motion blur effect to the target image, or a motion blur vector image of an image with the same motion blur effect as the target image, or a motion blur vector image of any other image. No specific restrictions are imposed here.

[0025] In one implementation, the first channel of the motion blur vector image is bound to the horizontal coordinate (i.e., the x-axis coordinate) of the motion vector information, and the second channel is bound to the vertical coordinate (i.e., the y-axis coordinate) of the motion vector information. For example, the first channel can be the red channel of the RGB three primary color channels, and the second channel can be the green channel of the RGB three primary color channels, or the first channel can be the green channel of the RGB three primary color channels, and the second channel can be the red channel of the RGB three primary color channels. The specific implementation is not limited here.

[0026] In one implementation, the motion blur range in the motion blur vector image includes at least one motion blur region, and the motion blur direction in the motion blur vector image includes the motion blur direction corresponding to each motion blur region. The motion blur vector image also includes a motion offset expression corresponding to each motion blur direction. For example, suppose the motion blur vector image is divided into two motion blur regions, which together form the motion blur range. Suppose one motion blur region is a foreground object in the target image, such as a person and horse riding a horse, while the other motion blur region is the background part of the target image, such as a grassland. Then, the foreground object can have its motion blur direction defined by a first motion offset expression, and the background part can have its different motion blur directions defined by a second motion offset expression, thereby creating a running motion blur effect.

[0027] In one embodiment, the motion blur range in a motion-blurred vector image can be defined using a subject recognition algorithm. Specifically, step S10 includes: performing subject recognition on the target image using a preset subject recognition algorithm to obtain the subject portion and non-subject portion of the target image, defining the subject portion as a first motion blur range and the non-subject portion as a second motion blur range, wherein the first motion blur range corresponds to a first motion blur direction, and the second motion blur range corresponds to a second motion blur direction. It should be noted that the subject recognition algorithm can be any algorithm used for image subject recognition, such as a subject recognition algorithm based on a neural network model, a subject recognition algorithm based on edge detection, etc., and is not specifically limited here. This embodiment can quickly define the motion blur range of the target image using a subject recognition algorithm, thereby improving the generation efficiency of motion-blurred vector images and the production efficiency of motion blur effects.

[0028] Step S20: Based on the motion blur vector image, perform motion blur processing on the target image through vector blur nodes to obtain a motion blur image.

[0029] Understandably, compositing nodes are used to freely combine different materials or effects. Vector blur nodes, also known as motion blur nodes, are a type of compositing node. They are used to apply motion blur effects to target images, such as the vector blur node in Nuke and the motion blur node in Fusion. In one implementation, the motion blur vector image is first bound to the target image, and then the vector blur node is used to generate a motion blur effect on the target image according to the corresponding motion blur direction and range, resulting in a motion blur image. Specifically, since the UV channels are the value channels used for motion blur effect rendering, binding the motion blur direction and range in the motion blur vector image to the UV channels of the target image allows the vector blur node to generate the motion blur effect on the target image, thus obtaining a motion blur image.

[0030] Understandably, the vector blur node can also dynamically adjust the motion blur parameters of the motion-blurred image, thus allowing for more flexible adjustments to the motion blur effect of the target image. These motion blur parameters include, but are not limited to, motion amount, UV offset, and UV alpha, etc., without specific limitations here. It should be noted that the motion blur direction and range indicated by the motion blur vector image can also be dynamically adjusted after obtaining the motion-blurred image, and the effect can be viewed in real time, making the creation of motion blur effects more intuitive and efficient.

[0031] The motion-blurred image generation method provided in the above embodiments controls the motion-blurred effect of the target image by generating a motion-blurred vector image containing the motion-blurred direction and motion-blurred range, and processes the motion blur through vector blur nodes, thereby flexibly and efficiently generating motion-blurred images with the desired effect.

[0032] Please see Figure 2 Another embodiment of the method for generating motion-blurred images in this invention includes:

[0033] Step S201: Create the initial vector graphic;

[0034] In this step, a vector graphic without motion vector information is created using a preset vector graphic creation expression, resulting in an initial vector graphic. In one implementation, when creating the initial vector graphic, the first channel of the created vector graphic is bound to the horizontal coordinate (i.e., the x-axis coordinate) of the motion vector information, and the second channel is bound to the vertical coordinate (i.e., the y-axis coordinate) of the motion vector information, thus obtaining the initial vector graphic. The first channel can be any channel in the RGB channels, and the second channel can be any channel in the RGB channels other than the first channel; specific limitations are not specified here.

[0035] In one implementation, the initial vector graphic can be the same size as the target image, or it can be a size that is a preset multiple larger than the target image. For example, assuming the target image is 960px × 1280px, the initial vector graphic can be 960px × 1280px, or it can be a size that is enlarged by 1.2 times, i.e., 1152px × 1536px, where px is the unit of pixels, and the specific size is not limited here.

[0036] Step S202: Obtain the target angle value, and perform a directional offset of the initial vector map coordinates using the target angle value to obtain the first vector map;

[0037] In one implementation, the target angle value differs from the rotate attribute in the vector graphic; it is a custom attribute. This target angle value can be set through a custom attribute, such as the main attribute in a node. The key is to ensure that when performing a directional offset of the initial vector graphic using the target angle value, the target angle value obtained is the one from this custom attribute.

[0038] In this step, displacement information is first calculated for the target angle value to obtain target displacement information. Then, the initial vector image is offset in a directional manner using the target displacement information to obtain the first vector image. It is understandable that directly defining the target angle value cannot determine the displacement distance of each pixel in the target image, thus failing to determine the motion blur direction of each pixel. Therefore, in this step, the target angle value is converted into displacement information, thereby determining the motion blur direction of each pixel in the target image through the displacement information. The target angle value ranges from 360°. This range can start from any angle; any angle value forming a 360° range with the starting angle can be used as the target angle value. For example, if the starting angle of this range is -180°, then the range is [-180°, 180°]. If the starting angle is 0°, then the range is [0°, 360°]. The specific range is not limited here. Understandably, as the target angle value changes within its range, the target displacement information will also form a directional offset within a circular range. For example, there is a situation where, when the target angle value is 0°, the target displacement information of a certain pixel in the first vector image is located in the fourth quadrant; when the target angle value is 90°, the target displacement information of that pixel in the first vector image is located in the third quadrant; when the target angle value is 180°, the target displacement information of that pixel in the first vector image is located in the second quadrant; and when the target angle value is 360°, the target displacement information of that pixel in the first vector image is located in the first quadrant. It can be seen that by calculating the directional offset coordinates of the target angle value, the obtained target displacement information still has the directional attribute of the target angle value and can be used to indicate the direction of motion blur.

[0039] In one embodiment, a first vector image is obtained by directionally offsetting the coordinates of an initial vector image using a target angle value. This includes: enlarging the initial vector image by a preset factor to obtain an enlarged vector image; transforming the target angle value to obtain directional offset coordinate values; the directional offset coordinate values ​​include directional offset coordinate values ​​for both the horizontal and vertical coordinates; and offsetting the enlarged vector image using the directional offset coordinate values ​​to obtain the first vector image. It is understood that if the size of the initial vector image is the same as the size of the target image, some pixels may overflow during coordinate offsetting. Therefore, in this embodiment, the initial vector image is first enlarged by a preset factor to obtain the enlarged vector image. This preset factor corresponds to the maximum value of the offset; for example, if the maximum value of the directional offset coordinate value is 1.25 times the original coordinate value, then the preset factor is 1.25. The specific value is not limited here.

[0040] In this embodiment, the target angle value can be converted into coordinate values ​​using a preset angle conversion formula, resulting in directed offset coordinate values. For example, the preset angle conversion formula can convert 20° into (17, -47), meaning the directed offset coordinate value for the horizontal axis is 17 and the directed offset coordinate value for the vertical axis is 47. The specific values ​​are not limited here. Next, based on the directed offset coordinates, all pixels in the enlarged vector image are offset to obtain the first vector image. For example, assuming the directed offset coordinate value is (17, -47), then the coordinate value of the pixel (1,1) in the enlarged vector image after offset is (18, -46). The specific values ​​are not limited here.

[0041] In one embodiment, the target angle value is converted into a directed offset coordinate value, including: converting the target angle value into a target radian value according to the conversion relationship between angle and radian; performing trigonometric function calculations on the target radian value to obtain the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate; multiplying the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate by a preset multiplier to obtain the directed offset coordinate values ​​of the horizontal coordinate and the vertical coordinate. In one embodiment, the trigonometric functions include sine and cosine functions. This embodiment is a specific method for converting angle values ​​into coordinate values. First, according to the conversion relationship between angle and radian, the target angle value is converted into a target radian value, where 1° = π / 180 radians, approximately equal to 0.0174533 radians. For example, 20° = 20 × π / 180 = 20 × 0.0174533 = 0.349066. Next, the target radian value is limited to between -1 and 1 using sine and cosine functions. That is, sine and cosine calculations are performed on the target radian value respectively. The sine calculation result is the unit coordinate offset of the horizontal axis, and the cosine calculation result is the unit coordinate offset of the vertical axis. For example, assuming the target radian value is 0.349066, then the sine and cosine calculations on 0.349066 respectively yield a sine result of 0.34202 and a cosine calculation result of 0.939693. Therefore, the unit coordinate offset of the horizontal axis is 0.34202, and the unit coordinate offset of the vertical axis is 0.939693. The specific values ​​are not limited here. Finally, since the unit coordinate offset is insufficient to cause a coordinate shift, the coordinate offset is increased by doubling the unit coordinate offset. This is done by multiplying the unit coordinate offsets of the horizontal and vertical coordinates by a preset multiplier, resulting in the directed offset coordinate values ​​for the horizontal and vertical coordinates. For example, assuming the unit coordinate offset of the horizontal coordinate is 0.34202, the unit coordinate offset of the vertical coordinate is 0.939693, and the preset multiplier is 50, then 0.34202 × 50 = 17.101, 0.939693 × 50 = 46.9846. That is, the directed offset coordinate value of the horizontal coordinate is 17.101, and the directed offset coordinate value of the vertical coordinate is 46.9846, resulting in a directed offset coordinate value of (17.101, 46.9846). The exact values ​​are not specified here. It should be noted that the preset multiplier corresponds to the preset multiplier used to enlarge the initial vector graphic.

[0042] In one embodiment, after transforming the target angle value into a coordinate value to obtain a directed offset coordinate value, the method further includes: copying the directed offset coordinate value of the horizontal axis to a first channel value, and copying the directed offset coordinate value of the vertical axis to a second channel value. In this embodiment, if the channel is not bound to the horizontal and vertical coordinates of the motion vector information, the calculated directed offset coordinate value can be assigned to the channel by copying. Specifically, the directed offset coordinate value of the horizontal axis is copied to the first channel value, and the directed offset coordinate value of the vertical axis is copied to the second channel value. The first channel value can be the color value of any channel in the RGB channels, and the second channel value can be the color value of any channel in the RGB channels other than the first channel. In one embodiment, the first channel value is the red channel value, and the second channel value is the green channel value.

[0043] Step S203: Determine the motion blur range of the first vector image to obtain a motion blur vector image; the motion blur vector image is used to indicate the motion blur direction and motion blur range;

[0044] In this step, the motion blur range of the first vector graphic can be defined in different ways, such as using a brush tool to define the motion blur range, using a mask layer to limit the motion blur range, or using a subject recognition algorithm to depict the motion blur range. The specific method of definition is not limited here. It can be understood that the vector graphic defining the motion blur range (i.e., the motion blur vector graphic) only contains pixels within the motion blur range, or in other words, the motion blur vector graphic only contains motion vector information of pixels within the motion blur range. Pixels outside the motion blur range do not contain motion vector information. For example, assuming the motion vector information is stored in the RG channel, then pixels within the motion blur range contain RG channel values, while pixels outside the motion blur range have RG channel values ​​of 0 or null, indicating that pixels outside the motion blur range are not subject to motion blur processing.

[0045] In one embodiment, step S203 includes: drawing a motion blur range on a first vector graphic using a brush to obtain a second vector graphic; and removing pixels outside the motion blur range from the second vector graphic to obtain a motion-blurred vector graphic. In this embodiment, to determine the pixels within the motion blur range, a motion blur range is drawn on the first vector graphic using a brush to obtain a second vector graphic, and then pixels outside the motion blur range are removed from the second vector graphic to obtain a motion-blurred vector graphic. Removing pixels outside the motion blur range from the second vector graphic can be done by clearing the motion vector information of these pixels, such as setting the RG channel values ​​of these pixels to zero.

[0046] In one embodiment, step S203 includes: enlarging the initial vector image by a preset factor to obtain an enlarged vector image; drawing a motion blur range on the first vector image using a brush to obtain a second vector image; and subtracting the pixel color values ​​of the second vector image and the enlarged vector image to obtain a motion-blurred vector image. In this embodiment, since the initial vector image contains the most original motion vector information, such as the most original RG channel information, after enlarging the initial vector image by a preset factor to obtain an enlarged vector image, drawing the motion blur range in the first vector image using a brush to obtain the second vector image, and then subtracting the pixel color values ​​of the second vector image and the enlarged vector image to obtain the motion-blurred vector image, where the pixel color values ​​contain motion vector information, such as the RG channel value. For example, assuming the R channel value (i.e., the red value) of a pixel in the enlarged vector image is 50, and the R channel value of the same pixel in the second vector image is 10, then the R channel value of the pixel in the motion-blurred vector image is 50-10=40. The specific value is not limited here. It's understandable that subtracting pixel color values ​​from the second vector graphic and the enlarged vector graphic means subtracting corresponding color values ​​from pixels. For example, red values ​​correspond to red values, green values ​​to green values, and blue values ​​to blue values. That is, the red values ​​in the second vector graphic are subtracted from the red values ​​in the enlarged vector graphic, the green values ​​in the second vector graphic are subtracted from the green values ​​in the enlarged vector graphic, and the blue values ​​in the second vector graphic are subtracted from the blue values ​​in the enlarged vector graphic. For example... Figure 3 As shown in the figure, the white area represents the motion blur range, and the black area represents the non-motion blur range; the specifics are not limited here.

[0047] In one embodiment, step S203 further includes: defining the motion blur range of the first vector image by using a brush to determine the depth of motion blur, thereby obtaining a motion-blurred vector image; the depth is used to indicate the degree of motion blur. Figure 4 The image shows a vector graphic created by brushes at different depths. The deeper the brush stroke, the greater the motion blur within that area; conversely, the lighter the brush stroke, the smaller the motion blur within that area. In one implementation, different depths of drawing can be achieved by changing the brush's drawing mode, transparency, hardness, and other attributes. In another implementation, the depth of brush strokes can also be changed by controlling the pressure applied to the drawing tool. For example, applying different pressures to the pressure-sensitive pen on a digital drawing tablet can control the brush to create different depths of drawing.

[0048] Step S204: Based on the motion blur vector image, perform motion blur processing on the target image through vector blur nodes to obtain a motion blur image.

[0049] It is understandable that, besides first performing a directional offset of the coordinates and then defining the motion blur range, one can also first define the motion blur range and then perform a directional offset of the coordinates. Specifically, step S10 above also includes: creating an initial vector map; defining the motion blur range of the initial vector map to obtain a third vector map; obtaining the target angle value, and performing a directional offset of the coordinates of the third vector map using the target angle value to obtain a motion-blurred vector map of the target image. In this embodiment, after creating the initial vector map, the motion blur range of the initial vector map is first defined to obtain a third vector map. The method of defining the motion blur range is the same as the method of defining the motion blur range in step S203 above, and will not be repeated here. Then, the third vector map is directionally offset of the coordinates using the target angle value to obtain a motion-blurred vector map. The method of directional offset of the coordinates is the same as the method of directional offset in step S202 above, and will not be repeated here.

[0050] In one embodiment, step S204 includes: determining the motion blur channel layer of the target image and copying the target channel values ​​from the motion blur vector image to the motion blur channel layer; the target channel values ​​include the directed offset coordinate values ​​of all pixels in the motion blur vector image; binding the motion blur channel layer to the UV channel of the target image, and performing motion blur processing on the target image based on the UV channel through vector blur nodes to obtain a motion blur image. In this embodiment, since the motion blur direction of the target image is controlled by the UV channel, the target channel values ​​from the motion blur vector image are first copied to the motion blur channel layer. The target channel values ​​include the first channel value and the second channel value mentioned above. The target channel values ​​contain the directed offset coordinate values ​​in the motion vector information. The motion blur channel layer can be a custom channel layer, such as move.u and move.v, apple.u and apple.v, or a preset channel layer, such as forward.u and forward.v, backward.u and backward.v, etc., and is not specifically limited here. Finally, by associating the motion blur channel layer with the UV channel of the target image, the motion blur effect of the target image can be generated based on the vector blur node, thus obtaining a motion-blurred image.

[0051] In one implementation, the amount of motion blur in the motion-blurred image can be adjusted using a motion amount parameter. Specifically, after step S204, the method further includes adjusting the motion blur size of the motion-blurred image using the motion amount parameter of the vector blur node to obtain an adjusted motion-blurred image. For example, in Nuke, adjusting the motion amount can adjust the amount of motion blur (i.e., the size of the motion blur), thereby obtaining the adjusted motion-blurred image.

[0052] In one implementation, the motion blur direction of the motion-blurred image can also be adjusted using a target angle value. Specifically, step S204 includes adjusting the target angle value to adjust the motion blur direction, thereby obtaining a motion-blurred image with adjusted motion blur direction. For example, assuming the target angle value is set through a custom main attribute, the motion blur direction of the motion-blurred image can be dynamically adjusted by dynamically adjusting the main attribute value, thus obtaining a motion-blurred image with adjusted motion blur direction.

[0053] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 5 The diagram shows a motion-blurred image generation device, which includes: a generation module 50 for generating a motion-blurred vector image of a target image; the motion-blurred vector image is used to indicate the direction and range of motion blur; and a blurring module 52 for performing motion blur processing on the target image based on the motion-blurred vector image through vector blur nodes to obtain a motion-blurred image.

[0054] The aforementioned motion-blurred image generation device controls the motion-blurred effect of the target image by generating a motion-blurred vector image containing the motion-blurred direction and range, and processes the motion blur through vector blur nodes, thus flexibly and efficiently generating motion-blurred images with the desired effect.

[0055] The aforementioned generation module is also used to: create an initial vector map; obtain a target angle value, and perform a directional offset of the initial vector map coordinates using the target angle value to obtain a first vector map; and define the motion blur range of the first vector map to obtain a motion-blurred vector map.

[0056] The aforementioned generation module is also used to: enlarge the initial vector image by a preset factor to obtain an enlarged vector image; convert the target angle value into coordinate values ​​to obtain a directed offset coordinate value; the directed offset coordinate value includes the directed offset coordinate values ​​of the horizontal and vertical coordinates; and offset the enlarged vector image by the directed offset coordinate value to obtain a first vector image.

[0057] The aforementioned generation module is further configured to: convert the target angle value into a target radian value according to the conversion relationship between angle and radian; perform trigonometric function calculations on the target radian value to obtain the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate; and multiply the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate by a preset multiple to obtain the directed offset coordinate value of the horizontal coordinate and the directed offset coordinate value of the vertical coordinate.

[0058] The aforementioned generation module is also used to: copy the directed offset coordinate value of the horizontal coordinate in the directed offset coordinate value to the first channel value, and copy the directed offset coordinate value of the vertical coordinate in the directed offset coordinate value to the second channel value.

[0059] The aforementioned generation module is also used to: draw the motion blur range of the first vector image using a brush to obtain the second vector image; and remove pixels outside the motion blur range from the second vector image to obtain the motion-blurred vector image.

[0060] The aforementioned generation module is also used to: enlarge the initial vector image by a preset factor to obtain an enlarged vector image; draw a motion blur range on the first vector image using a brush to obtain a second vector image; and subtract the pixel color values ​​of the second vector image and the enlarged vector image to obtain a motion-blurred vector image.

[0061] The aforementioned generation module is also used to: define the motion blur range of the target depth on the first vector image using a brush, thereby obtaining a motion-blurred vector image; the depth is used to indicate the degree of motion blur.

[0062] The aforementioned generation module is also used to: create an initial vector map; define the motion blur range of the initial vector map to obtain a third vector map; obtain the target angle value, and perform a directional offset of the third vector map coordinates using the target angle value to obtain a motion-blurred vector map of the target image.

[0063] The aforementioned blur module is further configured to: determine the motion blur channel layer of the target image and copy the target channel value from the motion blur vector image to the motion blur channel layer; the target channel value includes the directional offset coordinate value of all pixels in the motion blur vector image; bind the motion blur channel layer to the UV channel of the target image, and perform motion blur processing on the target image based on the UV channel through vector blur nodes to obtain a motion blur image.

[0064] The aforementioned device further includes: a first adjustment module, used to: adjust the motion blur size of the motion-blurred image by using the motion quantity parameter of the vector blur nodes, to obtain an adjusted motion-blurred image.

[0065] The aforementioned device further includes: a second adjustment module, used to: adjust the target angle value to adjust the motion blur direction, thereby obtaining a motion blur image with the motion blur direction adjusted.

[0066] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-described method for generating motion-blurred images. This electronic device can be a server or a terminal device.

[0067] See Figure 6As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described method for generating motion-blurred images.

[0068] Furthermore, Figure 6 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0069] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0070] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101. The processor 100 reads information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments, for example:

[0071] Generate a motion blur vector image of the target image; the motion blur vector image is used to indicate the direction and range of motion blur; based on the motion blur vector image, the target image is processed by vector blur nodes to obtain a motion blur image.

[0072] In this method, the motion blur effect of the target image is controlled by generating a motion blur vector image containing the motion blur direction and motion blur range, and the motion blur is processed by the vector blur node, which can flexibly and efficiently generate motion blur images with the desired effect.

[0073] The above-mentioned method for generating a motion-blurred vector image of the target image includes: creating an initial vector image; obtaining a target angle value and performing a directional offset on the initial vector image using the target angle value to obtain a first vector image; and defining the motion blur range of the first vector image to obtain a motion-blurred vector image.

[0074] The above-mentioned method of directionally offsetting the initial vector map with the target angle value to obtain the first vector map includes: enlarging the initial vector map by a preset factor to obtain the enlarged vector map; transforming the target angle value to obtain directional offset coordinate values; the directional offset coordinate values ​​include directional offset coordinate values ​​of the horizontal and vertical coordinates; and offsetting the enlarged vector map with the directional offset coordinate values ​​to obtain the first vector map.

[0075] The above-mentioned coordinate transformation of the target angle value to obtain the directed offset coordinate value includes: converting the target angle value into a target radian value according to the conversion relationship between angle and radian; performing trigonometric function calculations on the target radian value to obtain the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate; and multiplying the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate by a preset multiple to obtain the directed offset coordinate value of the horizontal coordinate and the directed offset coordinate value of the vertical coordinate.

[0076] After performing coordinate transformation on the target angle value to obtain the directed offset coordinate value, the method further includes: copying the directed offset coordinate value of the horizontal coordinate in the directed offset coordinate value to the first channel value, and copying the directed offset coordinate value of the vertical coordinate in the directed offset coordinate value to the second channel value.

[0077] The above-mentioned process of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: drawing the motion blur range of the first vector image using a brush to obtain a second vector image; and removing pixels outside the motion blur range from the second vector image to obtain a motion-blurred vector image.

[0078] The above-mentioned process of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: enlarging the initial vector image by a preset factor to obtain an enlarged vector image; drawing the motion blur range of the first vector image using a brush to obtain a second vector image; and subtracting the pixel color values ​​of the second vector image and the enlarged vector image to obtain a motion-blurred vector image.

[0079] The above-mentioned process of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: defining the motion blur range of the first vector image by using a brush to determine the depth of the target motion blur, thereby obtaining a motion-blurred vector image; the depth is used to indicate the degree of motion blur.

[0080] The above-mentioned method for generating a motion-blurred vector image of the target image includes: creating an initial vector image; defining the motion blur range of the initial vector image to obtain a third vector image; obtaining the target angle value, and performing a directional offset of the third vector image coordinates using the target angle value to obtain the motion-blurred vector image of the target image.

[0081] The above-mentioned motion blur image is obtained by performing motion blur processing on the target image based on the motion blur vector image and through vector blur nodes. The process includes: determining the motion blur channel layer of the target image and copying the target channel values ​​from the motion blur vector image to the motion blur channel layer; the target channel values ​​include the directed offset coordinate values ​​of all pixels in the motion blur vector image; binding the motion blur channel layer to the UV channel of the target image, and performing motion blur processing on the target image based on the UV channel through vector blur nodes to obtain the motion blur image.

[0082] After performing motion blur processing on the target image using vector blur nodes to obtain a motion-blurred image based on the above motion-blurred vector image, the method further includes: adjusting the motion blur size of the motion-blurred image using the motion quantity parameter of the vector blur nodes to obtain an adjusted motion-blurred image.

[0083] After performing motion blur processing on the target image using vector blur nodes based on the above motion blur vector diagram to obtain a motion blur image, the method further includes: adjusting the target angle value to adjust the motion blur direction, thereby obtaining a motion blur image with the motion blur direction adjusted.

[0084] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When these machine-executable instructions are invoked and executed by a processor, they cause the processor to implement the aforementioned method for generating motion-blurred images, for example:

[0085] Generate a motion blur vector image of the target image; the motion blur vector image is used to indicate the direction and range of motion blur; based on the motion blur vector image, the target image is processed by vector blur nodes to obtain a motion blur image.

[0086] In this method, the motion blur effect of the target image is controlled by generating a motion blur vector image containing the motion blur direction and motion blur range, and the motion blur is processed by the vector blur node, which can flexibly and efficiently generate motion blur images with the desired effect.

[0087] The above-mentioned method for generating a motion-blurred vector image of the target image includes: creating an initial vector image; obtaining a target angle value and performing a directional offset on the initial vector image using the target angle value to obtain a first vector image; and defining the motion blur range of the first vector image to obtain a motion-blurred vector image.

[0088] The above-mentioned method of directionally offsetting the initial vector map with the target angle value to obtain the first vector map includes: enlarging the initial vector map by a preset factor to obtain the enlarged vector map; transforming the target angle value to obtain directional offset coordinate values; the directional offset coordinate values ​​include directional offset coordinate values ​​of the horizontal and vertical coordinates; and offsetting the enlarged vector map with the directional offset coordinate values ​​to obtain the first vector map.

[0089] The above-mentioned coordinate transformation of the target angle value to obtain the directed offset coordinate value includes: converting the target angle value into a target radian value according to the conversion relationship between angle and radian; performing trigonometric function calculations on the target radian value to obtain the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate; and multiplying the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate by a preset multiple to obtain the directed offset coordinate value of the horizontal coordinate and the directed offset coordinate value of the vertical coordinate.

[0090] After performing coordinate transformation on the target angle value to obtain the directed offset coordinate value, the method further includes: copying the directed offset coordinate value of the horizontal coordinate in the directed offset coordinate value to the first channel value, and copying the directed offset coordinate value of the vertical coordinate in the directed offset coordinate value to the second channel value.

[0091] The above-mentioned process of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: drawing the motion blur range of the first vector image using a brush to obtain a second vector image; and removing pixels outside the motion blur range from the second vector image to obtain a motion-blurred vector image.

[0092] The above-mentioned process of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: enlarging the initial vector image by a preset factor to obtain an enlarged vector image; drawing the motion blur range of the first vector image using a brush to obtain a second vector image; and subtracting the pixel color values ​​of the second vector image and the enlarged vector image to obtain a motion-blurred vector image.

[0093] The above-mentioned process of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: defining the motion blur range of the first vector image by using a brush to determine the depth of the target motion blur, thereby obtaining a motion-blurred vector image; the depth is used to indicate the degree of motion blur.

[0094] The above-mentioned method for generating a motion-blurred vector image of the target image includes: creating an initial vector image; defining the motion blur range of the initial vector image to obtain a third vector image; obtaining the target angle value, and performing a directional offset of the third vector image coordinates using the target angle value to obtain the motion-blurred vector image of the target image.

[0095] The above-mentioned motion blur image is obtained by performing motion blur processing on the target image based on the motion blur vector image and through vector blur nodes. The process includes: determining the motion blur channel layer of the target image and copying the target channel values ​​from the motion blur vector image to the motion blur channel layer; the target channel values ​​include the directed offset coordinate values ​​of all pixels in the motion blur vector image; binding the motion blur channel layer to the UV channel of the target image, and performing motion blur processing on the target image based on the UV channel through vector blur nodes to obtain the motion blur image.

[0096] After performing motion blur processing on the target image using vector blur nodes to obtain a motion-blurred image based on the above motion-blurred vector image, the method further includes: adjusting the motion blur size of the motion-blurred image using the motion quantity parameter of the vector blur nodes to obtain an adjusted motion-blurred image.

[0097] After performing motion blur processing on the target image using vector blur nodes based on the above motion blur vector diagram to obtain a motion blur image, the method further includes: adjusting the target angle value to adjust the motion blur direction, thereby obtaining a motion blur image with the motion blur direction adjusted.

[0098] The computer program product of the motion-blurred image generation method, apparatus, electronic device, and storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0099] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0100] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0101] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0102] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0103] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for generating motion-blurred images, characterized in that, The method includes: Generate a motion blur vector image of the target image; the motion blur vector image is used to indicate the direction and range of motion blur. Based on the motion-blurred vector image, the target image is motion-blurred through vector blur nodes to obtain a motion-blurred image; The motion-blurred vector image of the generated target image includes: Create an initial vector graphic; Obtain the target angle value, and perform a directional offset on the initial vector map using the target angle value to obtain the first vector map; The motion blur range of the first vector image is defined to obtain a motion-blurred vector image. The step of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: The second vector image is obtained by applying motion blur to the first vector image using a brush. Remove pixels outside the motion blur range in the second vector image to obtain a motion-blurred vector image; The step of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: The motion blur vector is obtained by defining the range of motion blur of the target depth on the first vector image using a brush; the depth is used to indicate the degree of motion blur.

2. The method according to claim 1, characterized in that, The step of performing a directional offset of the initial vector map using the target angle value to obtain the first vector map includes: The initial vector image is enlarged by a preset factor to obtain an enlarged vector image; The target angle value is transformed into a coordinate value to obtain a directed offset coordinate value; the directed offset coordinate value includes the directed offset coordinate values ​​of the horizontal and vertical coordinates; The first vector graphic is obtained by offsetting the magnified vector graphic using the directional offset coordinate values.

3. The method according to claim 2, characterized in that, The step of performing coordinate transformation on the target angle value to obtain a directional offset coordinate value includes: Based on the conversion relationship between angle and radian, the target angle value is converted into a target radian value; The target radian value is calculated using trigonometric functions to obtain the unit coordinate offset of the horizontal axis and the unit coordinate offset of the vertical axis. Multiply the unit coordinate offset of the horizontal coordinate and the unit coordinate offset of the vertical coordinate by a preset multiple to obtain the directed offset coordinate values ​​of the horizontal coordinate and the vertical coordinate.

4. The method according to claim 2 or 3, characterized in that, After performing coordinate transformation on the target angle value to obtain the directional offset coordinate value, the method further includes: Copy the x-coordinate of the directed offset coordinate value to the first channel value, and copy the y-coordinate of the directed offset coordinate value to the second channel value.

5. The method according to claim 1, characterized in that, The process of performing motion blur processing on the target image based on the motion blur vector image, through vector blur nodes, to obtain a motion blur image includes: Determine the motion blur channel layer of the target image, and copy the target channel values ​​from the motion blur vector image to the motion blur channel layer; the target channel values ​​include the directed offset coordinate values ​​of all pixels in the motion blur vector image; The motion blur channel layer is bound to the UV channel of the target image, and motion blur processing is performed on the target image based on the UV channel through a vector blur node to obtain a motion blur image.

6. The method according to claim 1, characterized in that, After performing motion blur processing on the target image based on the motion blur vector image through vector blur nodes to obtain a motion blur image, the process further includes: The motion blur size of the motion-blurred image is adjusted by using the motion quantity parameter of the vector blur node to obtain the adjusted motion-blurred image.

7. The method according to claim 1, characterized in that, After performing motion blur processing on the target image based on the motion blur vector image through vector blur nodes to obtain a motion blur image, the process further includes: The target angle value is adjusted to adjust the motion blur direction, resulting in a motion blur image with the motion blur direction adjusted.

8. A method for generating motion-blurred images, characterized in that, The method includes: Generate a motion blur vector image of the target image; the motion blur vector image is used to indicate the direction and range of motion blur. Based on the motion-blurred vector image, the target image is motion-blurred through vector blur nodes to obtain a motion-blurred image; The motion-blurred vector image of the generated target image includes: Create an initial vector graphic; Obtain the target angle value, and perform a directional offset on the initial vector map using the target angle value to obtain the first vector map; The motion blur range of the first vector image is defined to obtain a motion-blurred vector image. The step of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: The initial vector image is enlarged by a preset factor to obtain an enlarged vector image; The second vector image is obtained by applying motion blur to the first vector image using a brush. Subtracting the pixel color values ​​from the second vector graphic and the enlarged vector graphic yields a motion-blurred vector graphic. The step of defining the motion blur range of the first vector image to obtain a motion-blurred vector image includes: The motion blur vector is obtained by defining the range of motion blur of the target depth on the first vector image using a brush; the depth is used to indicate the degree of motion blur.

9. An apparatus for generating motion-blurred images, characterized in that, The device includes: The generation module is used to generate a motion blur vector image of the target image; the motion blur vector image is used to indicate the direction and range of motion blur. The blur module is used to perform motion blur processing on the target image based on the motion blur vector image and through vector blur nodes to obtain a motion blur image; The generation module is further configured to: Create an initial vector graphic; Obtain the target angle value, and then perform a directional offset on the initial vector map using the target angle value to obtain the first vector map; The motion blur range is defined on the first vector image to obtain the motion-blurred vector image; The generation module is further configured to: The second vector image is obtained by applying motion blur to the first vector image using a brush. Remove pixels outside the motion blur range from the second vector image to obtain the motion blur vector image; The generation module is further configured to: The motion blur vector is obtained by defining the range of motion blur of the target depth on the first vector image using a brush; the depth is used to indicate the degree of motion blur.

10. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method for generating motion-blurred images according to any one of claims 1-8.

11. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for generating motion-blurred images according to any one of claims 1-8.