Motion Blur Processing Method, Device, Electronic Device, and Storage Medium
By acquiring and mapping the relative position parameters of the lens and photosensitive element of the video frame, the problem of low manual processing efficiency in the prior art is solved, and automated and efficient motion fuzzing processing is realized.
Patent Information
- Application Number
- CN202211314145.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-10-25
Smart Images

Figure CN115802178B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and in particular to a method, device, electronic device, and storage medium for motion blur processing. Background Art
[0002] In recent years, in film and television production, in order to enhance the realism of videos, appropriate lens motion blur is often rendered for videos. However, generating lens motion blur requires the object to move relative to the camera. Once the camera and the object move relative to each other, the perspective of the object in the video will change, which may not be the effect desired by some directors. In this case, the movement of the photosensitive element is used to achieve the effect of pseudo-relative movement, similar to the principle of a tilt-shift camera, that is, by using the movement of the lens relative to the photosensitive element, the object moves relative to the lens.
[0003] However, since the object does not move relative to the camera when shooting a video of an object in motion, it is necessary to manually add the movement of the lens relative to the photosensitive element in the rendering software, which is not convenient for motion blur processing of the video. Summary of the Invention
[0004] Embodiments of this application provide a method, device, electronic device, and storage medium for motion blur processing, which can improve the efficiency of motion blur processing for videos.
[0005] Embodiments of this application provide a method for motion blur processing, including:
[0006] Obtain a first parameter corresponding to a video frame, where the first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter of the relative position between the lens and the photosensitive element in the camera when the video frame is recorded;
[0007] Determine an adjustment coefficient mapped from the first parameter to a target software;
[0008] According to the adjustment coefficient, perform a correction process on the first sub-parameter to obtain a first corrected sub-parameter;
[0009] According to each first corrected sub-parameter, determine a second parameter corresponding to the video frame in the target software;
[0010] Based on the second parameter corresponding to each video frame in the video in the target software, perform motion blur processing on the video to obtain a video with motion blur.
[0011] Embodiments of this application also provide a motion blur processing device, including:
[0012] An acquisition unit, configured to acquire a first parameter corresponding to a video frame, where the first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter of the relative position between a lens and an image sensor in a camera when the video frame is recorded;
[0013] A mapping unit, configured to determine an adjustment coefficient for mapping the first parameter into a target software;
[0014] A correction unit, configured to perform a correction process on the first sub-parameter according to the adjustment coefficient to obtain a first corrected sub-parameter;
[0015] A determination unit, configured to determine a second parameter corresponding to the video frame in the target software according to each first corrected sub-parameter;
[0016] A blurring unit, configured to perform a motion blurring process on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain a motion-blurred video.
[0017] An embodiment of the present application further provides an electronic device, including a memory storing a plurality of instructions; the processor loads the instructions from the memory to execute the steps in any one of the motion blurring processing methods provided by the embodiments of the present application.
[0018] An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any one of the motion blurring processing methods provided by the embodiments of the present application.
[0019] An embodiment of the present application can acquire a first parameter corresponding to a video frame, where the first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter of the relative position between a lens and an image sensor in a camera when the video frame is recorded; determine an adjustment coefficient for mapping the first parameter into a target software; perform a correction process on the first sub-parameter according to the adjustment coefficient to obtain a first corrected sub-parameter; determine a second parameter corresponding to the video frame in the target software according to each first corrected sub-parameter; perform a motion blurring process on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain a motion-blurred video.
[0020] In the present application, the first sub-parameter can be mapped into the target software by using the adjustment coefficient, and the second parameter corresponding to the video frame in the target software can be determined. Thus, the second parameter corresponding to each video frame in the video in the target software can be quickly obtained, so that the target software can perform a motion blurring process on the video according to the second parameter corresponding to each video frame in the video, improving the efficiency of the motion blurring process on the video. Description of the Drawings
[0021] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0022] Figure 1a It is a schematic diagram of the scenario of the motion blur processing method provided by the embodiment of the present application;
[0023] Figure 1b It is a schematic flowchart of the motion blur processing method provided by the embodiment of the present application;
[0024] Figure 2 It is a schematic flowchart of the motion blur processing method applied in the application scenario provided by the embodiment of the present application;
[0025] Figure 3 It is a schematic structural diagram of the motion blur processing method device provided by the embodiment of the present application;
[0026] Figure 4 It is a schematic structural diagram of the electronic device provided by the embodiment of the present application. Detailed implementation manners
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0028] The embodiments of the present application provide a motion blur processing method, device, electronic device, and storage medium.
[0029] Among them, the motion blur processing device can be specifically integrated in an electronic device, and the electronic device can be a device such as a terminal or a server. Among them, the terminal can be a device such as a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, or a personal computer (PC); the server can be a single server or a server cluster composed of multiple servers.
[0030] In some embodiments, the motion blur processing device can also be integrated in multiple electronic devices. For example, the motion blur processing device can be integrated in multiple servers, and the motion blur processing method of the present application can be implemented by multiple servers.
[0031] In some embodiments, the server can also be implemented in the form of a terminal.
[0032] Currently, when performing motion blur processing on a video, it is necessary to manually add the movement of the lens relative to the photosensitive element to each frame of the video in the rendering software, so that the rendering software can simulate the movement of the camera when shooting the video based on the movement of the lens relative to the photosensitive element corresponding to each frame of the video. However, this method has a large workload and is cumbersome, and it is difficult for humans to accurately restore the movement of the lens relative to the photosensitive element, resulting in this method being only applicable to rendering motion blur in pictures.
[0033] For example, referring to Figure 1a , the electronic device can obtain a first parameter corresponding to a video frame, the first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter of the relative position between the lens and the photosensitive element in the camera when recording the video frame; determine an adjustment coefficient for mapping the first parameter to a target software; perform a correction process on the first sub-parameter according to the adjustment coefficient to obtain a first corrected sub-parameter; determine a second parameter corresponding to the video frame in the target software according to each first corrected sub-parameter; and perform motion blur processing on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain a video with motion blur.
[0034] Among them, the adjustment coefficient can be used to map the first sub-parameter to the target software and determine the second parameter corresponding to the video frame in the target software. In this way, the movement of the lens relative to the photosensitive element corresponding to the video frame can be accurately restored in the target software, and the second parameter corresponding to each video frame in the video in the target software can be quickly obtained, enabling the target software to perform motion blur processing on the video based on the second parameter corresponding to each video frame in the video, improving the efficiency of performing motion blur processing on the video.
[0035] The following will be described in detail respectively. It should be noted that the serial numbers of the following embodiments do not limit the preferred order of the embodiments.
[0036] In this embodiment, a motion blur processing method is provided. As Figure 1b shown, the specific process of this motion blur processing method can be as follows:
[0037] 110. Obtain a first parameter corresponding to a video frame, the first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter of the relative position between the lens and the photosensitive element in the camera when recording the video frame.
[0038] Among them, the video frame is any frame image in the video to be subjected to motion blur processing.
[0039] The first parameter includes all parameters of the relative movement between the lens and the photosensitive element in the camera.
[0040] The first sub-parameter is a parameter of the relative position between the lens and the photosensitive element in the camera when recording a video frame. For example, the first sub-parameter can be a parameter obtained by the relative movement of the lens with respect to the photosensitive element, and the first sub-parameter can also be a parameter obtained by the relative movement of the photosensitive element with respect to the lens. Among them, the first sub-parameter can specifically be a parameter of the relative horizontal translation between the lens and the photosensitive element, or a parameter of the relative vertical translation between the lens and the photosensitive element, or the coordinates of the center point of the photosensitive element after the photosensitive element rotates relative to the lens, or the angle of rotation of the photosensitive element relative to the lens, or the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element, or the order of the relative translation and rotation of the photosensitive element with respect to the lens, and so on.
[0041] The camera can cause relative movement between the lens and the photosensitive element when recording a video frame. For example, the camera can be a tilt-shift camera, or a virtual camera in video post-processing software, and so on.
[0042] The lens is used to project the light reflected by the object to be photographed onto the photosensitive element of the camera through the refraction and focusing of the lens glass to form an image. The lens can be a tilt-shift lens, or a virtual lens, and so on.
[0043] The photosensitive element is used to generate an image based on the light entering the lens. For example, the photosensitive element can be a physical photosensitive element, or a virtual photosensitive element, and so on.
[0044] It can be understood that when the camera is a tilt-shift camera, the first sub-parameter is a parameter of the relative movement of the lens in the camera with respect to the photosensitive element when recording a video frame. When the camera is a virtual camera in video processing software, the first sub-parameter is a parameter of the relative movement of the photosensitive element in the virtual camera with respect to the lens when recording a video frame.
[0045] It can be understood that the virtual camera in video post-processing software can be a fish-eye camera, an orthographic camera, a panoramic camera, and so on.
[0046] It can be understood that the video post-processing software is a mid-term 3D software that can produce three-dimensional content such as models, animations, and features, and is used to render video frames in the video. The video post-processing software can be Maya software, Cinema 4D software, Blender software, 3Dsmax software, Houdini software, and so on.
[0047] In some embodiments, considering that the lens can undergo various relative movements with respect to the photosensitive element, the first sub-parameters at least include a translation parameter, a rotation parameter, and a scaling parameter. The translation parameter is the displacement value of the relative translation between the lens and the photosensitive element, the rotation parameter is the parameter of the relative rotation between the lens and the photosensitive element, and the scaling parameter is the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element.
[0048] Among them, the translation parameter is the displacement value of the relative translation between the lens and the photosensitive element. For example, the translation parameter may include the parameter of the relative horizontal translation between the lens and the photosensitive element, the parameter of the relative vertical translation between the lens and the photosensitive element, and so on.
[0049] The rotation parameter is the parameter of the relative rotation between the lens and the photosensitive element. For example, the rotation parameter may include the coordinates of the center point of the photosensitive element after the photosensitive element rotates relative to the lens, the angle of rotation of the photosensitive element relative to the lens, the order of translation and rotation of the photosensitive element relative to the lens, and so on.
[0050] The scaling parameter is the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element. For example, the scaling parameter may be the focal length.
[0051] 120. Determine the adjustment coefficient for mapping the first parameter into the target software.
[0052] Among them, the target software is video post-processing software for synthesizing video frames after special effects processing. For example, the target software may be Nuke software, Fusion software, After Effects software, and so on.
[0053] The adjustment coefficient is used to map the first parameter into the target software.
[0054] It can be understood that there are differences in the relative positions between the lens and the photosensitive element between the target software and the camera. In order to map the first parameter into the target software, it is necessary to first determine the adjustment coefficient for mapping the first parameter into the target software, and the adjustment coefficient is used to compensate for the differences in relative positions between the target software and the camera.
[0055] In some embodiments, considering that there are differences in the relative positions between the lens and the photosensitive element between the target software and the camera, in order to compensate for the differences in relative positions between the target software and the camera, determining the adjustment coefficient for mapping the first parameter into the target software includes:
[0056] Determine the position differences between the target software and the camera, and the position differences include the differences in each relative position between the target software and the camera;
[0057] According to the position differences, determine the adjustment coefficient for mapping the first parameter into the target software.
[0058] Among them, the position difference includes the differences of each relative position between the target software and the camera.
[0059] For example, the position difference may be that the same relative position has opposite directions in the camera and the target software. Specifically, in the camera, the displacement parameter of the lens translating left relative to the photosensitive element is negative, while in the target software, the displacement parameter of the lens translating left relative to the photosensitive element is positive, that is, the horizontal displacements in the same direction have different displacement parameters in the camera and the target software.
[0060] It can be understood that if the relative displacement between the lens and the photosensitive element has a direction, this relative displacement can have the same direction or the opposite direction in the camera and the target software.
[0061] If the position difference means that the same relative position has a direction difference in the camera and the target software, the adjustment coefficient can be "-1" to map the relative position in the camera to the target software so that the displacement direction of this relative position in the target software is the same as that in the camera.
[0062] If the position difference means that the same relative position has no direction difference in the camera and the target software, the adjustment coefficient can be "1", which indicates that the displacement direction in the camera is the same as that in the target software.
[0063] For example, the position difference can also be that the same relative displacement has different displacement units between the camera and the target software. Specifically, in the camera, the displacement unit of the lens translating left relative to the photosensitive element is centimeter, and in the target software, the displacement parameter of the lens translating left relative to the photosensitive element is millimeter.
[0064] If in the camera, the displacement unit of the lens translating left relative to the photosensitive element is centimeter, and in the target software, the displacement parameter of the lens translating left relative to the photosensitive element is millimeter, the adjustment coefficient can be "10".
[0065] 130. According to the adjustment coefficient, perform correction processing on the first sub-parameter to obtain a first corrected sub-parameter.
[0066] Among them, the first corrected sub-parameter is the parameter obtained by mapping the first sub-parameter to the target software. For example, the first corrected sub-parameter can be the parameter obtained by mapping the horizontal displacement between the lens and the photosensitive element to the target software, or the parameter obtained by mapping the rotation of the lens relative to the photosensitive element to the target software, or the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element mapped to the target software, and so on.
[0067] For example, in a camera, the displacement parameter for the lens to translate left relative to the photosensitive element is negative, and the displacement parameter for the lens to translate right relative to the photosensitive element is positive. In the target software, however, the displacement parameter for the lens to translate left relative to the photosensitive element is positive, and the displacement parameter for the lens to translate right relative to the photosensitive element is negative. That is, the adjustment coefficient is "-1". Multiply the adjustment coefficient "-1" by the first sub-parameter to obtain the first corrected sub-parameter.
[0068] For example, in a camera, the displacement parameter for the lens to translate left relative to the photosensitive element is positive, and the displacement parameter for the lens to translate right relative to the photosensitive element is negative. In the target software, the displacement parameter for the lens to translate left relative to the photosensitive element is positive, and the displacement parameter for the lens to translate right relative to the photosensitive element is negative. That is, the adjustment coefficient is "1". Multiply the adjustment coefficient "1" by the first sub-parameter to obtain the first corrected sub-parameter.
[0069] For example, in a camera, the displacement unit for the horizontal translation of the lens relative to the photosensitive element is centimeters, while in the target software, the displacement parameter for the horizontal translation of the lens relative to the photosensitive element is millimeters. Then the adjustment coefficient can be "10". Multiply the adjustment coefficient "10" by the first sub-parameter to obtain the first corrected sub-parameter. In some embodiments, considering that there are multiple differences in the relative positions between the camera and the target software, in order to make up for each difference specifically, the adjustment coefficient includes multiple sub-coefficients. The sub-coefficients correspond to the relative positions. According to the adjustment coefficient, the first sub-parameter is corrected to obtain the first corrected sub-parameter, including:
[0070] Determine the target sub-coefficient corresponding to the first sub-parameter from multiple sub-coefficients according to the relative position;
[0071] According to the target sub-coefficient, the first sub-parameter is corrected to obtain the first corrected sub-parameter.
[0072] Among them, the sub-coefficient is the coefficient in the adjustment coefficient corresponding to the relative position between the lens and the photosensitive element. For example, in a camera, there are multiple relative positions between the lens and the photosensitive element, and each relative position corresponds to a sub-coefficient. Through the sub-coefficient, the relative position corresponding to the video frame in the camera can be mapped to the target software.
[0073] The target sub-coefficient is the sub-coefficient in the adjustment coefficient corresponding to the relative position. For example, the target sub-coefficient can be the sub-coefficient corresponding to the parameter of the relative horizontal translation between the lens and the photosensitive element, or the sub-coefficient corresponding to the parameter of the relative vertical translation between the lens and the photosensitive element, or the sub-coefficient corresponding to the center point coordinates of the photosensitive element after the photosensitive element rotates relative to the lens, or the sub-coefficient corresponding to the rotation angle of the photosensitive element relative to the lens, or the sub-coefficient corresponding to the focal length scaling value, and so on.
[0074] In some embodiments, considering that some relative movements between the lens and the photosensitive element are controlled by other objects in the camera, while some relative movements are not controlled by other objects in the camera, there are two types of first sub-parameters. Different types of first sub-parameters have different correction processing methods. According to the adjustment coefficient, the first sub-parameters are corrected to obtain the first corrected sub-parameters, including:
[0075] Obtain a link, where the link indicates that the first sub-parameters are controlled by other objects in the camera;
[0076] According to the link, classify multiple first sub-parameters to obtain a first type and a second type. The first sub-parameters of the first type carry the link relative to the second type;
[0077] According to the adjustment coefficient, correct the first sub-parameters of the first type to obtain the first corrected sub-parameters of the first type;
[0078] According to the adjustment coefficient, correct the first sub-parameters of the second type to obtain the first corrected sub-parameters of the second type.
[0079] Wherein, the link indicates that the first sub-parameters are controlled by other objects in the camera.
[0080] The first sub-parameters of the first type carry the link, so that the first sub-parameters of the first type are controlled by other objects in the camera.
[0081] The other object is an object in the camera that controls the first sub-parameters of the first type. For example, the other object can be the focus in the camera. When the focus moves, it can drive the relative movement between the lens and the photosensitive element. For example, the other object can also be a positioning element carried on the camera. When the positioning element deviates, it can drive the relative movement between the lens and the photosensitive element, and so on.
[0082] The first sub-parameters of the first type are controlled by other objects in the camera, that is, the first sub-parameters corresponding to each video frame in the video are not fixed. For example, the video includes video frame 1, video frame 2, and video frame 3. The first sub-parameters corresponding to each video frame in the video can all be different, that is, the first sub-parameters corresponding to video frame 1, video frame 2, and video frame 3 can be a, b, and c respectively. The first sub-parameters corresponding to each video frame in the video can be partially different, that is, the first sub-parameters corresponding to video frame 1, video frame 2, and video frame 3 can be a, b, and a respectively.
[0083] The first sub-parameter of the second type is not controlled by other objects in the camera, that is, each video frame in the video corresponds to the same first sub-parameter of the second type. For example, the video includes video frame 1, video frame 2, and video frame 3, and the first sub-parameters of the second type corresponding to video frame 1, video frame 2, and video frame 3 can be a, a, and a respectively.
[0084] The first corrected sub-parameter of the first type is the parameter after correcting the first sub-parameter of the first type.
[0085] The first corrected sub-parameter of the second type is the parameter after correcting the first sub-parameter of the second type. For example, since each video frame in the video corresponds to the same first sub-parameter of the second type, the first sub-parameter of the second type corresponding to each video frame in the video can be corrected, and the first sub-parameter of the second type corresponding to one video frame in the video can also be corrected.
[0086] In some embodiments, considering that the first sub-parameter of the first type is controlled by other objects in the camera, the first sub-parameters of the first type corresponding to each video frame in the video may be different. According to the adjustment coefficient, the first sub-parameter of the first type is corrected to obtain the first corrected sub-parameter of the first type, including:
[0087] Obtain the first sub-parameter of the first type corresponding to each video frame in the video;
[0088] According to the adjustment coefficient, correct the first sub-parameter of the first type corresponding to each video frame to obtain the first corrected sub-parameter of the first type corresponding to each video frame.
[0089] For example, since the first sub-parameters of the first type corresponding to each video frame in the video are not fixed, it is necessary to correct the first sub-parameters of the first type corresponding to each video frame in the video.
[0090] In some embodiments, considering that the first sub-parameter of the second type is not controlled by other objects in the camera, the first sub-parameters of the second type corresponding to each video frame in the video are the same. According to the adjustment coefficient, the first sub-parameter of the second type is corrected to obtain the first corrected sub-parameter of the second type, including:
[0091] Obtain the first sub-parameter of the second type corresponding to any one video frame in the video;
[0092] According to the adjustment coefficient, correct one first sub-parameter of the second type to obtain the first corrected sub-parameter of the second type.
[0093] For example, since each video frame in the video corresponds to the same first sub-parameter of the second type, the first sub-parameter of the second type corresponding to any video frame in the video can be corrected.
[0094] 140. Determine the second parameter corresponding to the video frame in the target software according to each first correction sub-parameter.
[0095] Wherein, the second parameter is the relative position between the lens and the photosensitive element in the target software obtained through the first correction sub-parameter.
[0096] For example, the relative position between the lens and the photosensitive element in the target software includes displacement, zoom, rotation, and center point. Then, the displacement in the target software can be calculated from the parameters of the relative horizontal translation and the relative vertical translation in the camera, the zoom can be calculated from the focal length zoom value corresponding to the relative distance between the lens and the photosensitive element, the rotation can be calculated from the angle of rotation of the photosensitive element relative to the lens, and the center point can be calculated from the coordinates of the center point of the photosensitive element after rotation relative to the lens.
[0097] In some embodiments, considering that the relative position is represented differently in the camera and the target software, the second parameter includes multiple second sub-parameters. Determining the second parameter corresponding to the video frame in the target software according to each first correction sub-parameter includes:
[0098] Obtain the preset relative position in the target software and the operator corresponding to the preset relative position, where the preset relative position is the relative position between the lens and the photosensitive element in the target software;
[0099] Determine the target correction sub-parameter from each first correction sub-parameter corresponding to the video frame according to the preset relative position and the relative position;
[0100] Substitute the target correction sub-parameter into the operator corresponding to the preset relative position to calculate the second sub-parameter corresponding to the video frame in the target software.
[0101] Wherein, the second sub-parameter is the parameter of the relative position between the lens and the photosensitive element in the target software.
[0102] The preset relative position is the relative position between the lens and the photosensitive element in the target software preset in the target software. For example, the preset relative position can be displacement, zoom, rotation, center point, etc.
[0103] The relative position indicated by the target correction sub-parameter in the camera is the same as the preset relative position. For example, the target correction sub-parameter corresponding to the preset relative position can be one first correction sub-parameter, or multiple first correction sub-parameters, etc.
[0104] It can be understood that the preset relative position is displacement, and the displacement can include horizontal displacement and vertical displacement. Then the target correction sub-parameters include the parameter of the relative horizontal translation between the lens and the photosensitive element in the corrected camera, and the parameter of the relative vertical translation between the lens and the photosensitive element in the corrected camera. If the preset relative position is zoom, the target correction sub-parameter is the focal length zoom value corresponding to the relative distance between the lens and the photosensitive element in the corrected camera. If the preset relative position is rotation, the target correction sub-parameter is the angle of the relative rotation of the photosensitive element with respect to the lens after correction. If the preset relative position is the center point, the target correction sub-parameter is the coordinates of the center point of the photosensitive element after the relative rotation of the photosensitive element with respect to the lens in the corrected camera, and so on.
[0105] The operator corresponding to the preset relative position is used to substitute the target correction sub-parameters to calculate the second sub-parameters corresponding to the preset relative position.
[0106] For example, the displacement of the preset position includes two operators. The first operator is the horizontal displacement of the lens relative to the photosensitive element, and the second operator is the vertical displacement of the lens relative to the photosensitive element. The first operator = the first target correction sub-parameter multiplied by the target image size. The second operator = the second target correction sub-parameter multiplied by the target image size. The first target correction sub-parameter is the parameter of the relative horizontal translation between the lens and the photosensitive element in the corrected camera. The target image size is the resolution of the video frame in the horizontal direction divided by 2. The second target correction sub-parameter is the parameter of the relative vertical translation between the lens and the photosensitive element in the corrected camera.
[0107] In some embodiments, considering that a relative position is at the center point of the image in the camera, while this relative position is at the lower left corner of the image in the target software. In order to set the relative position at the center point of the image in the target software, substitute the target correction sub-parameters into the operator corresponding to the preset relative position, and calculate the second sub-parameters corresponding to the video frame in the target software, including:
[0108] Obtain the bias term;
[0109] Use the bias term to correct the second sub-parameters to obtain the second corrected sub-parameters.
[0110] Among them, the bias term is used to correct the position of the second sub-parameters in the target software.
[0111] For example, the target correction sub-parameters indicate that the relative position is at the center point of the video frame in the camera, that is, the target correction sub-parameters can be (0, 0), while (0, 0) is at the lower left corner of the video frame in the target software. In order to make the photosensitive element rotate relative to the lens around the center point of the video frame in the target software, the second corrected sub-parameters located at the center of the video frame are obtained through the bias term.
[0112] In some embodiments, in order to enable users to easily distinguish parameters in the target software, the target correction sub-parameters are determined from each first correction sub-parameter corresponding to the video frame according to the preset relative position and relative position, including:
[0113] Obtain the mapping relationship between the custom identifier and the first correction sub-parameter in the target software;
[0114] Determine the target custom identifier corresponding to each first correction sub-parameter according to the mapping relationship;
[0115] According to the custom identifier in the operator corresponding to the preset relative position and the target custom identifier corresponding to the first correction sub-parameter, determine the target correction sub-parameter corresponding to the preset relative position from each first correction sub-parameter corresponding to the video frame. The operator corresponding to the preset relative position includes a custom identifier;
[0116] Substitute the target correction sub-parameter into the operator corresponding to the preset relative position, and calculate the second sub-parameter corresponding to the video frame in the target software, including:
[0117] Replace the custom identifier in the operator with the target correction sub-parameter, and calculate the second sub-parameter corresponding to the video frame in the target software.
[0118] Wherein, the custom identifier is an identifier set by the user in the target software corresponding to the first correction sub-parameter. For example, the custom identifier can be a symbol, a letter, a number, etc.
[0119] The mapping relationship is used to indicate the custom identifier corresponding to the first correction sub-parameter.
[0120] The target custom identifier is the custom identifier corresponding to the first correction sub-parameter.
[0121] The target correction sub-parameter is the first correction sub-parameter corresponding to the target custom identifier that is the same as the custom identifier in the operator.
[0122] For example, the displacement of the preset position includes two operators. The first operator is the horizontal displacement of the lens relative to the photosensitive element, and the second operator is the vertical displacement of the lens relative to the photosensitive element. The first operator = oriTrans.x * imgSize.x / 2, and the second operator = oriTrans.y * imgSize.x / 2. oriTrans.x, imgSize.x, oriTrans.y, and imgSize.x are custom identifiers set by the user. oriTrans.x is mapped to the first correction parameter A, which is the parameter of the relative horizontal translation between the lens and the photosensitive element in the corrected camera. oriTrans.y is mapped to the first correction parameter B, which is the parameter of the relative vertical translation between the lens and the photosensitive element in the corrected camera. imgSize.x is equal to the resolution of the video frame in the horizontal direction. Substitute the first correction parameter A into the first operator and substitute the first correction parameter B into the second operator to obtain the corresponding displacement of the video frame in the target software.
[0123] 150. Perform motion blur processing on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain a video with motion blur.
[0124] Among them, for the object recorded in the video, there are obvious motion blur traces in the video with motion blur.
[0125] For example, based on the second parameter corresponding to each video frame in the video in the target software, video frames with continuously changing positions can be obtained in the target software, so that the object recorded in the video can move relative to the lens in the video. In this way, through the motion blur effect existing in the target software, the user can rotate the object that needs to be motion-blurred in the video, and perform motion blur processing on the object in the video through the motion blur effect, so that the object in the video has obvious motion blur traces in the video.
[0126] In some embodiments, in order to enable the object to have a motion blur effect in the video, perform motion blur processing on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain a video with motion blur, including:
[0127] Determine the parameter change corresponding to the video according to the second parameter corresponding to each video frame in the video in the target software;
[0128] Perform motion blur processing on the video according to the parameter change to obtain a video with motion blur.
[0129] Among them, the parameter change is used to indicate the change in the imaging position of the object in each video frame of the video. Through the parameter change, the movement of the object in the video can be presented.
[0130] For example, by changing the parameters, the change in the imaging position of an object in a video can be obtained, that is, the moving object in the video can be obtained. Then, using the motion blur special effect in the target software, select the moving object in the video and perform motion blur processing on the moving object, so that there are obvious motion blur traces of the object in the video.
[0131] As can be seen from the above, the embodiment of the present application can obtain the first parameter corresponding to a video frame. The first parameter includes multiple first sub-parameters, and the first sub-parameter is the parameter of the relative position between the lens and the photosensitive element in the camera when recording the video frame. Determine the adjustment coefficient mapped from the first parameter to the target software. According to the adjustment coefficient, perform correction processing on the first sub-parameter to obtain the first corrected sub-parameter. According to each first corrected sub-parameter, determine the second parameter corresponding to the video frame in the target software. Based on the second parameter corresponding to each video frame in the video in the target software, perform motion blur processing on the video to obtain the video with motion blur.
[0132] Therefore, this solution can map the first sub-parameter to the target software using the adjustment coefficient and determine the second parameter corresponding to the video frame in the target software. Thus, the second parameter corresponding to each video frame in the video can be quickly obtained in the target software, enabling the target software to perform motion blur processing on the video according to the second parameter corresponding to each video frame in the video, improving the efficiency of motion blur processing on the video.
[0133] The method described in the above embodiment will be further described in detail below.
[0134] In this embodiment, taking the virtual camera in the Maya software as the camera and the Nuke software as the target software as an example, the method of the embodiment of the present application will be described in detail.
[0135] The specific process of a motion blur processing method is as follows:
[0136] 210. Obtain the first parameter corresponding to the video frame. The first parameter includes multiple first sub-parameters, and the first sub-parameter is the parameter of the relative position between the lens and the photosensitive element in the camera when recording the video frame.
[0137] For example, the first parameter is a parameter of the relative position between the lens and the photosensitive element in the virtual camera of Maya software (i.e., the film back attribute, filmback attribute, of the virtual camera in Maya software). Among them, the first sub-parameter in the first parameter may include the parameter of the relative horizontal translation between the lens and the photosensitive element (filmTranslateH); the parameter of the relative vertical translation between the lens and the photosensitive element (filmTranslateV); the coordinates of the center point of the photosensitive element after the photosensitive element rotates relative to the lens (fhorizontalRollPivot, verticalRollPivot), where horizontalRollPivot is the abscissa and verticalRollPivot is the ordinate; the angle of rotation of the photosensitive element relative to the lens (filmRollValue); the focal length scaling value (preScale) corresponding to the relative distance between the lens and the photosensitive element before the photosensitive element rotates relative to the lens; the focal length scaling value (postScale) corresponding to the relative distance between the lens and the photosensitive element after the photosensitive element rotates relative to the lens; the order of translation and rotation of the photosensitive element relative to the lens (filmRollOrder), and so on.
[0138] For example, the first sub-parameter corresponding to each video frame can be expressed as [frame number of the video frame, first sub-parameter], denoted by timeVal. The first sub-parameters corresponding to each video frame in the video can be expressed as [timeVal1, timeVal2,..., timeValN], denoted by timeVallist.
[0139] For example, the first sub-parameter A [[10, 0.5], [11, 0.6],..., [30, 0.2]], the first sub-parameter B [[10, 20], [11, 22],..., [30, 10]], the first sub-parameter C [[10, 1.0], [11, 1.05],..., [30, 1.2]], and so on.
[0140] 220. As Figure 2 shown, according to the link, classify multiple first sub-parameters to obtain a first type and a second type. The first sub-parameters of the first type carry a link relative to the first sub-parameters of the second type, and the link indicates that the first sub-parameters are controlled by other objects in the camera.
[0141] For example, the first type can be a static type, static type (Static, StaticAttrValDict), and the second type can be a dynamic type, dynamic type (Dynamic, DynamicAttrValDict). The first sub-parameters of the static type form a static parameter list, and the first sub-parameters of the dynamic attribute form a dynamic parameter list.
[0142] In some embodiments, the first sub-parameters of the first type and the first sub-parameters of the second type are stored.
[0143] 230. Determine the adjustment coefficient to which the first parameter is mapped in the target software.
[0144] For example, the adjustment coefficient (AttrFactorList) may include the first sub-parameter and the sub-coefficient corresponding to the first sub-parameter, specifically including filmTranslateH: -1, filmTranslateV: -1, horizontalRollPivot: 1, verticalRollPivot: 1, filmRollValue: 1, preScale: 1, postScale: 1.
[0145] For example, if the corresponding filmback attribute in Maya software is needed in Nuke software, the first sub-parameter in the filmback attribute needs to be multiplied by the corresponding sub-coefficient.
[0146] 240. According to the adjustment coefficient, perform correction processing on the first sub-parameters of the first type corresponding to each video frame to obtain the first corrected sub-parameters of the first type corresponding to each video frame.
[0147] For example, use the first sub-parameter of Maya × the sub-coefficient in the adjustment coefficient to generate the first corrected sub-parameter mapped to Nuke. If the first sub-parameter belongs to the dynamic type, such as the first sub-parameters of the first type corresponding to each video frame being [[10, 0.5], [11, 0.6], [12, 0.8]], and the sub-coefficient corresponding to the first sub-parameters of the first type being -1, the first corrected sub-parameters of the first type corresponding to each video frame generated can be {curve x10 -0.5x11 -0.6x12 -0.8}.
[0148] 250. According to the adjustment coefficient, perform correction processing on a first sub-parameter of the second type to obtain the first corrected sub-parameter of the second type.
[0149] For example, if the first sub-parameter belongs to the static type, such as the first sub-parameter being 1.2, and the sub-coefficient being -1, the generated first corrected sub-parameter is -1.2.
[0150] 260. According to each first corrected sub-parameter, determine the second parameter corresponding to the video frame in the target software.
[0151] In some embodiments, determining the second parameter corresponding to the video frame in the target software according to each first corrected sub-parameter includes:
[0152] Obtain the preset relative position in the target software and the operator corresponding to the preset relative position, where the preset relative position is the relative position between the lens and the photosensitive element in the target software;
[0153] Determine the target correction sub-parameter from each first correction sub-parameter corresponding to the video frame according to the preset relative position and the relative position;
[0154] Substitute the target correction sub-parameter into the operator corresponding to the preset relative position to calculate the second sub-parameter corresponding to the video frame in the target software.
[0155] For example, in the Nuke software, there is a preset template. The preset template includes multiple preset relative positions and the operators corresponding to the preset relative positions. Pasting the target correction sub-parameter into the operator corresponding to the preset relative position in the Nuke software can obtain the second sub-parameter. The preset relative positions include movement, scaling, rotation, center point, and custom identifier. If the second sub-parameter is not needed, the corresponding part can be deleted and the default value can be used.
[0156] For example, for the preset template in the Nuke software to add a custom identifier, after the Nuke software recognizes the custom identifier in the preset template, it will automatically add the corresponding first correction sub-parameter to the operator corresponding to the preset relative position in the Nuke software.
[0157] For example, (addUserKnob{20User}) represents the custom identifier that needs to be added by the user. addUserKnob{12} represents that the subsequent added data is a data of a 2-element array, including an x sub-property and a y sub-property. imgeSize{imgeSize[0]imgeSize[1]}. The custom identifier for the resolution of the video frame is imgeSize (short property name), imagesize (long property name). The value of the x sub-property is the 0th element of this 2-element array of imgeSize, and the value of the y sub-property is the 1st element of this 2-element array of imgeSize.
[0158] Among them, for the value of the x sub-property (the first corrected sub-parameter of the second type), the operator outAttrStr is called, and the parameter is the value of filmTranslateH output by the Maya software. That is to say, if filmTransalteH belongs to the static type, the value of filmTranslateH in StaticAttrValDict is obtained, and then input into the operator outAttrStr. The operator outAttrStr multiplies the first sub-parameter in the filmback attribute by the corresponding sub-coefficient, that is, outAttrStr(filmTranslateH), to obtain the corresponding parameter. If filmTranslateH is a dynamic attribute, the value of filmTranslateH in dynAttrValDict is obtained, and then input into the operator outAttrStr to obtain the first corrected sub-parameter corresponding to each video frame. And so on, the value of the y sub-property (the first corrected sub-parameter of the first type) is obtained through outAttrStr(filmTranlsateH).
[0159] The subsequent parts of the preset template respectively represent the custom identifier (a name recognizable by Nuke software), the detailed name of the custom identifier (a name that users can read and understand), and the short name of the custom identifier (a name recognizable by Nuke software).
[0160] The first content in the preset template:
[0161] (Ⅰ) Replace the preset relative position: translate{%s%s} in the preset template with translate{{"oriTrans.x*imgSize.x / 2"}{"oriTrans.y*imgSize.x / 2"}} to indicate the translation of the lens relative to the photosensitive element in the target software.
[0162] Among them, oriTrans is a 2D vector property newly added by the user, and its numerical correspondence is oriTrans.x = outAttrStr[filmTranslateH], oriTrans.y = outAttrStr[filmTranslateV], and imgSize is the size of the video frame, similar to 960, 540.
[0163] outAttrStr[filmTranslateH] is the first corrected sub-parameter A, and the first corrected sub-parameter A is the parameter for the relative horizontal translation between the corrected lens and the photosensitive element. outAttrStr[filmTranslateV] is the first corrected sub-parameter B, and the first corrected sub-parameter B is the parameter for the relative vertical translation between the corrected lens and the photosensitive element.
[0164] (Ⅱ) Replace the preset relative position in the preset template:
[0165] Scale{%s} with Scale{outAttrStr(preScale)}, which indicates the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element in the target software.
[0166] Among them, outAttrStr(preScale) is the first correction sub-parameter C, and the first correction sub-parameter C is the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element before the photosensitive element rotates relative to the lens after correction.
[0167] (Ⅲ) If the filmRollOrder attribute of Maya is 0, it means that the photosensitive element is rotated first and then moved. Then replace the preset relative position in the preset template: rotate{%s} with rotate{outAttrStr(filmRollValue)}, which indicates the angle of rotation of the lens relative to the photosensitive element in the target software. If the filmRollOrder attribute is 1, it means that the photosensitive element is moved first and then rotated. Then replace rotate{%s} in the preset template with rotate{0}.
[0168] Among them, outAttrStr(filmRollValue) is the first correction sub-parameter D, and the first correction sub-parameter D is the angle of rotation of the photosensitive element relative to the lens after correction.
[0169] (Ⅳ) Replace the center{%s%s} in the preset template with center{{"oriCent.x*imgSize.x / 2+imgSize.x / 2"}{"oriCent.y*imgSize.x / 2+imgSize.y / 2"}}, where center indicates the coordinates of the center point of the photosensitive element relative to the lens after rotation.
[0170] original center, oriCent (the center point of video frame rotation), is an attribute created by the user in Nuke software. oriCent.x indicates the abscissa of the center point of the photosensitive element relative to the lens after rotation in Maya software, and oriCent.y indicates the ordinate of the center point of the photosensitive element relative to the lens after rotation in Maya software.
[0171] The original center, which is the center point of video frame rotation, is (0, 0) by default. imgSize is the resolution of the video frame. Since the center point of video frame rotation in Maya software is (0, 0) by default, which is the center point of the video frame. However, (0, 0) is at the lower left corner of the video frame in Nuke software, so correction is needed.
[0172] That is, when the video frame in Maya software is imported into Nuke software, the center point of video frame rotation is placed at the center of the video frame resolution plus the offset value. The center of the video frame resolution is imgSize.x(y) / 2. Since Maya software compresses the video frame resolution to -1 to 1, while Nuke software determines the coordinates according to the actual resolution of the video frame, so the "1" of the horizontal coordinate in Maya software actually corresponds to half of the horizontal resolution of the video frame in Nuke software, and the "1" of the vertical coordinate in Maya software actually corresponds to half of the vertical resolution of the video frame in Nuke software. Therefore, the horizontal offset value == oriCent.x / 2 × imgSize.x, and the vertical offset value == oriCent.y / 2 × imgSize.y.
[0173] (Ⅴ) Replace the preset filling part in the preset template with custom content. The custom content includes the mapping relationship between the custom identifier and the first correction sub-parameter in the target software:
[0174] addUserKnob{20User};
[0175] addUserKnob{12imgSizel"image size"};
[0176] imgSize{imgeSize[0]imgeSize[1]};
[0177] addUserKnob{12oriTransl"original translate"};
[0178] oriTrans{outAttrStr(filmTranslateH)outAttrStr(filmTranslateV)};
[0179] addUserKnob{12oriCentl"original center"};
[0180] oriCent{outAttrStr(horizontalRollPivot)outAttrStr(verticalRollPivot).
[0181] Among them, addUserKnob{20User} is the starting template of the preset template, representing the custom identifier that needs to be added by the user. addUserKnob{12imgSizel"image size"}, addUserKnob{12oriTransl"originaltranslate"}, and oriTrans{outAttrStr(filmTranslateH), outAttrStr(filmTranslateV)} represent adding the custom identifier oriTrans, which is used to associate the horizontal and vertical offset values of the lens relative to the photosensitive element in the Maya software, namely filmTranslateH and filmTranslateV.
[0182] Among them, the short name of the attribute is oriTrans, and the long name of the attribute is original Translate.
[0183] Thus, replace the first content in the preset template:
[0184] translate{{"oriTrans.x*imgeSize.x / 2"}{"oriTrans.y*imgeSize.x / 2"}};
[0185] Scale{outAttrStr(preScale)};
[0186] rotate{outAttrStr(filmRollValue)} or rotate{0};
[0187] center{{"oriCent.x*imgeSize.x / 2+imgeSize.x / 2"}{"oriCent.y*imgeSize.x / 2+imgeSize.y / 2"}};
[0188] addUserKnob{20User};
[0189] addUserKnob{12imgeSize l"image size"};
[0190] imgeSize{imgeSize[0]imgeSize[1]};
[0191] addUserKnob{12oriTransl"original translate"};
[0192] oriTrans{outAttrStr(filmTranslateH)outAttrStr(filmTranslateV)};
[0193] addUserKnob{12oriCentl "original center"};
[0194] oriCent{outAttrStr(horizontalRollPivot)outAttrStr(verticalRollPivot)}.
[0195] The second content in the preset template:
[0196] (Ⅰ) If the filmRollOrder attribute of the Maya software is 1, generate the second content in the preset template; otherwise, do not generate it.
[0197] (Ⅱ) When filmRollOrder is 1, it means that the photosensitive element needs to be moved first and then the film is rotated. The first content in the preset template has already processed the effect of moving the photosensitive element, and now only the photosensitive element needs to be rotated.
[0198] (Ⅲ) Delete translate and Scale in the second content, that is, translate and Scale use the default attributes.
[0199] (Ⅳ) Replace rotate{%s} in the preset template with rotate{outAttrStr(filmRollValue)}.
[0200] (Ⅴ) Replace center{%s%s} in the preset template with center{{"oriCent.x*imgeSize.x / 2+imgeSize.x / 2"}{"oriCent.y*imgeSize.x / 2+imgeSize.y / 2"}}.
[0201] (Ⅵ) Finally, replace the preset filling part in the preset template with custom content:
[0202] addUserKnob{20User};
[0203] addUserKnob{12imgeSize l "image size"};
[0204] imgeSize{imgeSize[0]imgeSize[1]};
[0205] addUserKnob{12oriCentl"original center"};
[0206] oriCent{outAttrStr(horizontalRollPivot)outAttrStr(verticalRollPivot)}.
[0207] As Figure 2 shown, replace the second content in the preset template as follows:
[0208] rotate{outAttrStr(filmRollValue)};
[0209] center{{"oriCent.x*imgeSize.x / 2+imgeSize.x / 2"}{"oriCent.y*imgeSize.x / 2+imgeSize.y / 2"}};
[0210] addUserKnob{20User};
[0211] addUserKnob{12imgeSize l"image size"};
[0212] imgeSize{imgeSize[0]imgeSize[1]};
[0213] addUserKnob{12oriCentl"original center"};
[0214] oriCent{outAttrStr(horizontalRollPivot)outAttrStr(verticalRollPivot)}.
[0215] The third content in the preset template:
[0216] (Ⅰ), Delete translate and rotate in the preset template, that is, use the default attributes for translate and rotate.
[0217] (Ⅱ), Replace Scale{%s} in the preset template with Scale{outAttrStr(postScale)}.
[0218] (Ⅲ), Replace center{%s%s} in the preset template with center{{"imgeSize.x / 2"}{"imgeSize.y / 2"}}.
[0219] (Ⅳ), Finally, replace the preset filling part in the preset template with the custom content
[0220] addUserKnob{20User};
[0221] addUserKnob{12imgeSize l"image size"};
[0222] imgeSize{imgeSize[0]imgeSize[1]}.
[0223] Thus, replace the third content in the preset template:
[0224] Scale{outAttrStr(postScale)};
[0225] Center{{"imgeSize.x / 2"}{"imgeSize.y / 2"}};
[0226] addUserKnob{20User};
[0227] addUserKnob{12imgeSize l"image size"};
[0228] imgeSize{imgeSize[0]imgeSize[0]}.
[0229] 270. Based on the second parameter corresponding to each video frame in the video in the target software, perform motion blur processing on the video to obtain the video after motion blur.
[0230] For example, as Figure 2 shown, the first content, the second content, and the third content are combined, input into a text document or copied to the system clipboard, and then imported or pasted in the Nuke software, so that the relative motion between the Maya software lens and the photosensitive element can be accurately restored in the Nuke software.
[0231] As can be seen from the above, it has high versatility, is applicable to the cameras of Maya software. According to the specific camera type, and the mapping of the first parameter to the Nuke software is very fast, regardless of the versions of Maya software and Nuke software.
[0232] To better implement the above method, an embodiment of the present application further provides a motion blur processing device, which can be specifically integrated in an electronic device. The electronic device can be a terminal, a server, or other devices. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a personal computer, or other devices; the server can be a single server or a server cluster composed of multiple servers.
[0233] For example, in this embodiment, taking the motion blur processing device specifically integrated in the electronic device as an example, the method of the embodiment of the present application will be described in detail.
[0234] For instance, as Figure 3 shown, the motion blur processing device may include an acquisition unit 310, a mapping unit 320, a correction unit 330, a determination unit 340, and a blur unit 350, as follows:
[0235] (1). Acquisition unit 310.
[0236] The acquisition unit 310 is configured to acquire a first parameter corresponding to a video frame. The first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter of the relative position between the lens and the photosensitive element in the camera when the video frame is recorded.
[0237] In some embodiments, considering that the lens can have various relative movements with respect to the photosensitive element, the first sub-parameter at least includes a translation parameter, a rotation parameter, and a scaling parameter. The translation parameter is the displacement value of the relative translation between the lens and the photosensitive element, the rotation parameter is the parameter of the relative rotation between the lens and the photosensitive element, and the scaling parameter is the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element.
[0238] (2). Mapping unit 320.
[0239] The mapping unit 320 is configured to determine an adjustment coefficient for mapping the first parameter into the target software.
[0240] In some embodiments, determining the adjustment coefficient for mapping the first parameter into the target software includes:
[0241] Determining the position difference between the target software and the camera, where the position difference includes the difference of each relative position between the target software and the camera;
[0242] Determining the adjustment coefficient for mapping the first parameter into the target software according to the position difference.
[0243] (3). Correction unit 330.
[0244] The correction unit 330 is configured to perform correction processing on the first sub-parameter according to the adjustment coefficient to obtain a first corrected sub-parameter.
[0245] In some embodiments, the adjustment coefficient includes a plurality of sub - coefficients, the sub - coefficients correspond to relative positions, and according to the adjustment coefficient, the first sub - parameter is corrected to obtain a first corrected sub - parameter, including:
[0246] Determine a target sub - coefficient corresponding to the first sub - parameter from the plurality of sub - coefficients according to the relative position;
[0247] Correct the first sub - parameter according to the target sub - coefficient to obtain a first corrected sub - parameter.
[0248] In some embodiments, according to the adjustment coefficient, the first sub - parameter is corrected to obtain a first corrected sub - parameter, including:
[0249] Obtain a link, where the link indicates that the first sub - parameter is controlled by other objects in the camera;
[0250] Classify a plurality of first sub - parameters according to the link to obtain a first type and a second type. The first sub - parameters of the first type carry the link relative to the first sub - parameters of the second type;
[0251] Correct the first sub - parameters of the first type according to the adjustment coefficient to obtain first corrected sub - parameters of the first type;
[0252] Correct the first sub - parameters of the second type according to the adjustment coefficient to obtain first corrected sub - parameters of the second type.
[0253] In some embodiments, according to the adjustment coefficient, the first sub - parameters of the first type are corrected to obtain first corrected sub - parameters of the first type, including:
[0254] Obtain the first sub - parameters of the first type corresponding to each video frame in the video;
[0255] Correct the first sub - parameters of the first type corresponding to each video frame according to the adjustment coefficient to obtain first corrected sub - parameters of the first type corresponding to each video frame.
[0256] In some embodiments, according to the adjustment coefficient, the first sub - parameters of the second type are corrected to obtain first corrected sub - parameters of the second type, including:
[0257] Obtain the first sub - parameters of the second type corresponding to any one video frame in the video;
[0258] Correct one first sub - parameter of the second type according to the adjustment coefficient to obtain first corrected sub - parameters of the second type.
[0259] (IV). Determination unit 340.
[0260] Determining unit 340, configured to determine a second parameter corresponding to a video frame in a target software according to each first correction sub-parameter.
[0261] In some embodiments, the second parameter includes a plurality of second sub-parameters. Determining the second parameter corresponding to the video frame in the target software according to each first correction sub-parameter includes:
[0262] Obtaining a preset relative position in the target software and an operator corresponding to the preset relative position, where the preset relative position is the relative position between a lens and an image sensor in the target software;
[0263] Determining a target correction sub-parameter from each first correction sub-parameter corresponding to the video frame according to the preset relative position and the relative position;
[0264] Substituting the target correction sub-parameter into the operator corresponding to the preset relative position to calculate a second sub-parameter corresponding to the video frame in the target software.
[0265] In some embodiments, determining a target correction sub-parameter from each first correction sub-parameter corresponding to the video frame according to the preset relative position and the relative position includes:
[0266] Obtaining a mapping relationship between a custom identifier and a first correction sub-parameter in the target software;
[0267] Determining a target custom identifier corresponding to each first correction sub-parameter according to the mapping relationship;
[0268] Determining a target correction sub-parameter corresponding to the preset relative position from each first correction sub-parameter corresponding to the video frame according to the custom identifier in the operator corresponding to the preset relative position and the target custom identifier corresponding to the first correction sub-parameter, where the operator corresponding to the preset relative position includes a custom identifier;
[0269] Substituting the target correction sub-parameter into the operator corresponding to the preset relative position to calculate a second sub-parameter corresponding to the video frame in the target software includes:
[0270] Replacing the custom identifier in the operator with the target correction sub-parameter to calculate a second sub-parameter corresponding to the video frame in the target software.
[0271] (V). Blurring unit 350.
[0272] Blurring unit 350, configured to perform motion blurring processing on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain a motion-blurred video.
[0273] In some embodiments, performing motion blur processing on a video based on the second parameter corresponding to each video frame in the target software to obtain a video with motion blur includes:
[0274] Determining the parameter change corresponding to the video according to the second parameter corresponding to each video frame in the target software;
[0275] Performing motion blur processing on the video according to the parameter change to obtain a video with motion blur.
[0276] In specific implementation, each of the above units can be implemented as an independent entity, or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of each of the above units, reference can be made to the foregoing method embodiments, which will not be elaborated herein.
[0277] As can be seen from the above, the motion blur processing device in this embodiment obtains the first parameter corresponding to the video frame by the acquisition unit. The first parameter includes multiple first sub-parameters, and the first sub-parameter is the parameter of the relative position between the lens and the photosensitive element in the camera when recording the video frame; the mapping unit determines the adjustment coefficient mapped from the first parameter to the target software; the correction unit corrects the first sub-parameter according to the adjustment coefficient to obtain the first corrected sub-parameter; the determination unit determines the second parameter corresponding to the video frame in the target software according to each first corrected sub-parameter; the blur unit performs motion blur processing on the video based on the second parameter corresponding to each video frame in the target software to obtain a video with motion blur.
[0278] Therefore, the embodiments of the present application can improve the efficiency of performing motion blur processing on a video.
[0279] Correspondingly, the embodiments of the present application further provide an electronic device, which can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer, a personal digital assistant (Personal Digital Assistant, PDA), etc.
[0280] As Figure 4 shown, Figure 4 is a schematic structural diagram of the electronic device provided by the embodiments of the present application. The electronic device 400 includes a processor 410 with one or more processing cores, a memory 420 with one or more computer-readable storage media, and a computer program stored on the memory 420 and executable on the processor. Among them, the processor 410 is electrically connected to the memory 420. Those skilled in the art can understand that the structural diagram of the electronic device shown in the figure does not limit the electronic device, and it may include more or fewer components than shown in the figure, or combine some components, or arrange different components.
[0281] The processor 410 is the control center of the electronic device 400, connecting various parts of the entire electronic device 400 through various interfaces and circuits. By running or loading software programs and / or modules stored in the memory 420, and invoking data stored in the memory 420, it executes various functions of the electronic device 400 and processes data, thereby monitoring the entire electronic device 400.
[0282] In the embodiments of the present application, the processor 410 in the electronic device 400 will load the instructions corresponding to the processes of one or more application programs into the memory 420 according to the following steps, and the processor 410 will run the application programs stored in the memory 420 to implement various functions:
[0283] A motion blur processing method, including:
[0284] Obtain a first parameter corresponding to a video frame, where the first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter of the relative position between the lens and the photosensitive element in the camera when recording the video frame;
[0285] Determine an adjustment coefficient for mapping the first parameter to the target software;
[0286] According to the adjustment coefficient, perform correction processing on the first sub-parameter to obtain a first corrected sub-parameter;
[0287] According to each first corrected sub-parameter, determine a second parameter corresponding to the video frame in the target software;
[0288] Based on the second parameter corresponding to each video frame in the video in the target software, perform motion blur processing on the video to obtain a video with motion blur.
[0289] In some embodiments, considering that the lens can make various relative movements with respect to the photosensitive element, the first sub-parameter at least includes a translation parameter, a rotation parameter, and a scaling parameter. The translation parameter is the displacement value of the relative translation between the lens and the photosensitive element, the rotation parameter is the parameter of the relative rotation between the lens and the photosensitive element, and the scaling parameter is the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element.
[0290] In some embodiments, determining the adjustment coefficient for mapping the first parameter to the target software includes:
[0291] Determine the position difference between the target software and the camera, where the position difference includes the difference of each relative position between the target software and the camera;
[0292] According to the position difference, determine the adjustment coefficient for mapping the first parameter to the target software.
[0293] In some embodiments, the adjustment coefficient includes a plurality of sub - coefficients, the sub - coefficients correspond to relative positions, and according to the adjustment coefficient, the first sub - parameter is corrected to obtain a first corrected sub - parameter, including:
[0294] Determine a target sub - coefficient corresponding to the first sub - parameter from the plurality of sub - coefficients according to the relative position;
[0295] Correct the first sub - parameter according to the target sub - coefficient to obtain a first corrected sub - parameter.
[0296] In some embodiments, according to the adjustment coefficient, the first sub - parameter is corrected to obtain a first corrected sub - parameter, including:
[0297] Obtain a link, where the link indicates that the first sub - parameter is controlled by other objects in the camera;
[0298] Classify a plurality of first sub - parameters according to the link to obtain a first type and a second type, and the first sub - parameters of the first type carry the link relative to the first sub - parameters of the second type;
[0299] Correct the first sub - parameters of the first type according to the adjustment coefficient to obtain first corrected sub - parameters of the first type;
[0300] Correct the first sub - parameters of the second type according to the adjustment coefficient to obtain first corrected sub - parameters of the second type.
[0301] In some embodiments, according to the adjustment coefficient, the first sub - parameters of the first type are corrected to obtain first corrected sub - parameters of the first type, including:
[0302] Obtain the first sub - parameters of the first type corresponding to each video frame in the video;
[0303] Correct the first sub - parameters of the first type corresponding to each video frame according to the adjustment coefficient to obtain first corrected sub - parameters of the first type corresponding to each video frame.
[0304] In some embodiments, according to the adjustment coefficient, the first sub - parameters of the second type are corrected to obtain first corrected sub - parameters of the second type, including:
[0305] Obtain the first sub - parameters of the second type corresponding to any one video frame in the video;
[0306] Correct one first sub - parameter of the second type according to the adjustment coefficient to obtain a first corrected sub - parameter of the second type.
[0307] In some embodiments, the second parameter includes a plurality of second sub - parameters, and according to each first corrected sub - parameter, determine the second parameter corresponding to the video frame in the target software, including:
[0308] Obtain the preset relative position in the target software and the operator corresponding to the preset relative position, where the preset relative position is the relative position between the lens and the photosensitive element in the target software;
[0309] Determine the target correction sub-parameter from each first correction sub-parameter corresponding to the video frame according to the preset relative position and the relative position;
[0310] Substitute the target correction sub-parameter into the operator corresponding to the preset relative position, and calculate the second sub-parameter corresponding to the video frame in the target software.
[0311] In some embodiments, determining the target correction sub-parameter from each first correction sub-parameter corresponding to the video frame according to the preset relative position and the relative position includes:
[0312] Obtain the mapping relationship between the custom identifier in the target software and the first correction sub-parameter;
[0313] Determine the target custom identifier corresponding to each first correction sub-parameter according to the mapping relationship;
[0314] According to the custom identifier in the operator corresponding to the preset relative position and the target custom identifier corresponding to the first correction sub-parameter, determine the target correction sub-parameter corresponding to the preset relative position from each first correction sub-parameter corresponding to the video frame, and the operator corresponding to the preset relative position includes a custom identifier;
[0315] Substituting the target correction sub-parameter into the operator corresponding to the preset relative position and calculating the second sub-parameter corresponding to the video frame in the target software includes:
[0316] Replace the custom identifier in the operator with the target correction sub-parameter, and calculate the second sub-parameter corresponding to the video frame in the target software.
[0317] In some embodiments, performing motion blur processing on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain the video with motion blur includes:
[0318] Determine the parameter change corresponding to the video according to the second parameter corresponding to each video frame in the video in the target software;
[0319] Perform motion blur processing on the video according to the parameter change to obtain the video with motion blur.
[0320] In specific implementation, each of the above units can be implemented as an independent entity, or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of each of the above units, reference can be made to the foregoing method embodiments, which will not be elaborated herein.
[0321] For the specific implementation of each of the above operations, reference may be made to the foregoing embodiments, which will not be elaborated herein.
[0322] Optionally, as Figure 4 shown, the electronic device 400 further includes: a touch display screen 430, a radio frequency circuit 440, an audio circuit 450, an input unit 460, and a power supply 470. Among them, the processor 410 is electrically connected to the touch display screen 430, the radio frequency circuit 440, the audio circuit 450, the input unit 460, and the power supply 470 respectively. Those skilled in the art can understand that Figure 4 the structure of the electronic device shown in
[0323] does not limit the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0324] The radio frequency circuit 440 can be used to receive and transmit radio frequency signals to establish wireless communication with a network device or other electronic devices through wireless communication, and to receive and transmit signals between the network device or other electronic devices.
[0325] The audio circuit 450 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 450 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 450 and then converted into audio data. After the audio data is output to the processor 410 for processing, it is sent to another electronic device, for example, through the radio frequency circuit 440, or the audio data is output to the memory 420 for further processing. The audio circuit 450 may also include an earphone jack to provide communication between the peripheral earphone and the electronic device.
[0326] The input unit 460 can be used to receive input digital, character information or user characteristic information (such as fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0327] The power supply 470 is used to supply power to each component of the electronic device 400. Optionally, the power supply 470 can be logically connected to the processor 410 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 470 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0328] Although Figure 4 not shown in the figure, the electronic device 400 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.
[0329] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0330] As can be seen from the above, the electronic device provided in this embodiment can improve the efficiency of motion blur processing for videos.
[0331] Those of ordinary skill in the art can understand that all or part of the steps in the above various methods can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0332] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores multiple computer programs that can be loaded by a processor to execute the steps in any of the motion blur processing methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:
[0333] A motion blur processing method includes:
[0334] Obtain a first parameter corresponding to a video frame, where the first parameter includes multiple first sub-parameters, and the first sub-parameter is a parameter of the relative position between the lens and the photosensitive element in the camera when recording the video frame;
[0335] Determine an adjustment coefficient for mapping the first parameter into the target software;
[0336] According to the adjustment coefficient, perform a correction process on the first sub-parameter to obtain a first corrected sub-parameter;
[0337] According to each first corrected sub-parameter, determine a second parameter corresponding to the video frame in the target software;
[0338] Based on the second parameter corresponding to each video frame in the video in the target software, perform motion blur processing on the video to obtain a video with motion blur.
[0339] In some embodiments, considering that the lens can make various relative movements with respect to the photosensitive element, the first sub-parameter at least includes a translation parameter, a rotation parameter, and a scaling parameter. The translation parameter is the displacement value of the relative translation between the lens and the photosensitive element, the rotation parameter is the parameter of the relative rotation between the lens and the photosensitive element, and the scaling parameter is the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element.
[0340] In some embodiments, determining the adjustment coefficient for mapping the first parameter into the target software includes:
[0341] Determine the position difference between the target software and the camera, where the position difference includes the difference of each relative position between the target software and the camera;
[0342] According to the position difference, determine the adjustment coefficient for mapping the first parameter into the target software.
[0343] In some embodiments, the adjustment coefficient includes multiple sub-coefficients, and the sub-coefficient corresponds to the relative position. According to the adjustment coefficient, performing a correction process on the first sub-parameter to obtain a first corrected sub-parameter includes:
[0344] According to the relative position, determine the target sub-coefficient corresponding to the first sub-parameter from multiple sub-coefficients;
[0345] According to the target sub-coefficient, perform a correction process on the first sub-parameter to obtain a first corrected sub-parameter.
[0346] In some embodiments, according to an adjustment coefficient, the first sub-parameter is corrected to obtain a first corrected sub-parameter, including:
[0347] Obtain a link, where the link indicates that the first sub-parameter is controlled by other objects in the camera;
[0348] According to the link, classify multiple first sub-parameters to obtain a first type and a second type. The first sub-parameters of the first type carry the link relative to the second type;
[0349] According to the adjustment coefficient, correct the first sub-parameters of the first type to obtain the first corrected sub-parameters of the first type;
[0350] According to the adjustment coefficient, correct the first sub-parameters of the second type to obtain the first corrected sub-parameters of the second type.
[0351] In some embodiments, according to the adjustment coefficient, correct the first sub-parameters of the first type to obtain the first corrected sub-parameters of the first type, including:
[0352] Obtain the first sub-parameters of the first type corresponding to each video frame in the video;
[0353] According to the adjustment coefficient, correct the first sub-parameters of the first type corresponding to each video frame to obtain the first corrected sub-parameters of the first type corresponding to each video frame.
[0354] In some embodiments, according to the adjustment coefficient, correct the first sub-parameters of the second type to obtain the first corrected sub-parameters of the second type, including:
[0355] Obtain the first sub-parameters of the second type corresponding to any one video frame in the video;
[0356] According to the adjustment coefficient, correct one first sub-parameter of the second type to obtain the first corrected sub-parameters of the second type.
[0357] In some embodiments, the second parameter includes multiple second sub-parameters. According to each first corrected sub-parameter, determine the second parameter corresponding to the video frame in the target software, including:
[0358] Obtain a preset relative position in the target software and an operator corresponding to the preset relative position. The preset relative position is the relative position between the lens and the photosensitive element in the target software;
[0359] According to the preset relative position and the relative position, determine a target corrected sub-parameter from each first corrected sub-parameter corresponding to the video frame;
[0360] Substitute the target correction sub-parameter into the operator corresponding to the preset relative position, and calculate the second sub-parameter corresponding to the video frame in the target software.
[0361] In some embodiments, determining the target correction sub-parameter from each first correction sub-parameter corresponding to the video frame according to the preset relative position and the relative position includes:
[0362] Obtain the mapping relationship between the custom identifier in the target software and the first correction sub-parameter;
[0363] According to the mapping relationship, determine the target custom identifier corresponding to each first correction sub-parameter;
[0364] According to the custom identifier in the operator corresponding to the preset relative position and the target custom identifier corresponding to the first correction sub-parameter, determine the target correction sub-parameter corresponding to the preset relative position from each first correction sub-parameter corresponding to the video frame. The operator corresponding to the preset relative position includes a custom identifier;
[0365] Substitute the target correction sub-parameter into the operator corresponding to the preset relative position, and calculate the second sub-parameter corresponding to the video frame in the target software, including:
[0366] Replace the custom identifier in the operator with the target correction sub-parameter, and calculate the second sub-parameter corresponding to the video frame in the target software.
[0367] In some embodiments, based on the second parameter corresponding to each video frame in the video in the target software, perform motion blur processing on the video to obtain a video with motion blur, including:
[0368] Determine the parameter change corresponding to the video according to the second parameter corresponding to each video frame in the video in the target software;
[0369] According to the parameter change, perform motion blur processing on the video to obtain a video with motion blur.
[0370] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, and details are not described herein again.
[0371] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0372] Since the computer program stored in the storage medium can execute the steps in any of the motion blur processing methods provided in the embodiments of the present application, the beneficial effects achievable by any of the motion blur processing methods provided in the embodiments of the present application can be achieved. For details, reference may be made to the previous embodiments, and details are not described herein again.
[0373] The above has introduced in detail a motion blur processing method, device, electronic device, and storage medium provided by embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A method for motion blur processing, characterized in that, Including: Obtain a first parameter corresponding to a video frame, where the first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter representing the relative displacement between the lens and the photosensitive element in the camera when recording the video frame; Determine an adjustment coefficient for mapping the first parameter to a target software; According to the adjustment coefficient, perform a correction process on the first sub-parameter to obtain a first corrected sub-parameter; According to each first corrected sub-parameter, determine a second parameter corresponding to the video frame in the target software, where the relative displacement between the lens and the photosensitive element indicated by the second parameter in the target software is the same as the relative displacement between the lens and the photosensitive device in the camera; Based on the second parameter corresponding to each video frame in the video in the target software, perform motion blur processing on the video to obtain the video after motion blur.
2. The motion blur processing method according to claim 1, wherein The determining the adjustment coefficient for mapping the first parameter to the target software includes: Determine the position difference between the same relative position between the lens and the photosensitive element in the target software and the camera, where the position difference indicates the representation difference of the same relative position between the lens and the photosensitive element in the target software and the camera; According to the position difference, determine the adjustment coefficient for mapping the first parameter to the target software.
3. The motion blur processing method according to claim 2, wherein The adjustment coefficient includes a plurality of sub-coefficients, and the sub-coefficient corresponds to the relative position. The performing a correction process on the first sub-parameter according to the adjustment coefficient to obtain a first corrected sub-parameter includes: According to the relative position, determine a target sub-coefficient corresponding to the first sub-parameter from the plurality of sub-coefficients; According to the target sub-coefficient, perform a correction process on the first sub-parameter to obtain a first corrected sub-parameter.
4. The motion blur processing method according to claim 1, wherein The performing a correction process on the first sub-parameter according to the adjustment coefficient to obtain a first corrected sub-parameter includes: Obtain a link, where the link indicates that the first sub-parameter is controlled by other objects in the camera; According to the link, perform a classification process on the plurality of first sub-parameters to obtain a first type and a second type, and the first sub-parameters of the first type carry the link relative to the first sub-parameters of the second type; According to the adjustment coefficient, perform a correction process on the first sub-parameters of the first type to obtain the first corrected sub-parameters of the first type; According to the adjustment coefficient, perform a correction process on the first sub-parameters of the second type to obtain the first corrected sub-parameters of the second type.
5. The motion blur processing method according to claim 4, wherein The performing a correction process on the first sub-parameters of the first type according to the adjustment coefficient to obtain the first corrected sub-parameters of the first type includes: Obtain the first sub-parameters of the first type corresponding to each video frame in the video; According to the adjustment coefficient, perform a correction process on the first sub-parameters of the first type corresponding to each video frame to obtain the first corrected sub-parameters of the first type corresponding to each video frame.
6. The motion blur processing method according to claim 4, wherein, Performing a correction process on the first sub-parameter of the second type according to the adjustment coefficient to obtain the first corrected sub-parameter of the second type, includes: Obtaining the first sub-parameter of the second type corresponding to any one of the video frames in the video; Performing a correction process on the first sub-parameter of the second type according to the adjustment coefficient to obtain the first corrected sub-parameter of the second type.
7. The motion blur processing method according to claim 1, wherein The second parameter includes a plurality of second sub-parameters. Determining the second parameter corresponding to the video frame in the target software according to each of the first corrected sub-parameters, includes: Obtaining a preset relative position in the target software and an operator corresponding to the preset relative position, where the preset relative position is the relative position between the lens and the photosensitive element in the target software; Determining a target corrected sub-parameter from each of the first corrected sub-parameters corresponding to the video frame according to the preset relative position and the relative position; Substituting the target corrected sub-parameter into the operator corresponding to the preset relative position to calculate the second sub-parameter corresponding to the video frame in the target software.
8. The motion blur processing method according to claim 7, wherein, The determining a target corrected sub-parameter from each of the first corrected sub-parameters corresponding to the video frame according to the preset relative position and the relative position, includes: Obtaining the mapping relationship between the custom identifier in the target software and the first corrected sub-parameter; Determining the target custom identifier corresponding to each of the first corrected sub-parameters according to the mapping relationship; Determining the target corrected sub-parameter corresponding to the preset relative position from each of the first corrected sub-parameters corresponding to the video frame according to the custom identifier in the operator corresponding to the preset relative position and the target custom identifier corresponding to the first corrected sub-parameter, where the operator corresponding to the preset relative position includes the custom identifier; The substituting the target corrected sub-parameter into the operator corresponding to the preset relative position to calculate the second sub-parameter corresponding to the video frame in the target software, includes: Replacing the custom identifier in the operator with the target corrected sub-parameter to calculate the second sub-parameter corresponding to the video frame in the target software.
9. The motion blur processing method according to claim 1, wherein, Performing a motion blur process on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain the video after the motion blur, includes: Determining the parameter change corresponding to the video according to the second parameter corresponding to each video frame in the video in the target software; Performing a motion blur process on the video according to the parameter change to obtain the video after the motion blur.
10. The motion blur processing method according to claim 1, characterized in that, The first sub-parameter at least includes a translation parameter, a rotation parameter, and a scaling parameter. The translation parameter is the displacement value of the relative translation between the lens and the photosensitive element, the rotation parameter is the parameter of the relative rotation between the lens and the photosensitive element, and the scaling parameter is the focal length scaling value corresponding to the relative distance between the lens and the photosensitive element.
11. A motion blur processing device, characterized in that, Includes: An acquisition unit, configured to acquire a first parameter corresponding to a video frame, where the first parameter includes a plurality of first sub-parameters, and the first sub-parameter is a parameter representing the relative displacement between a lens and an image sensor in a camera when the video frame is recorded; A mapping unit, configured to determine an adjustment coefficient obtained by mapping the first parameter into a target software; A correction unit, configured to perform a correction process on the first sub-parameter according to the adjustment coefficient to obtain a first corrected sub-parameter; A determination unit, configured to determine a second parameter corresponding to the video frame in the target software according to each first corrected sub-parameter, where the relative displacement between the lens and the image sensor indicated by the second parameter in the target software is the same as the relative displacement between the lens and the image sensor in the camera; A blurring unit, configured to perform motion blurring processing on the video based on the second parameter corresponding to each video frame in the video in the target software to obtain the video after motion blurring; 12. An electronic device, characterized in that, Comprising a processor and a memory, where the memory stores a plurality of instructions; the processor loads the instructions from the memory to execute the steps in the motion blurring processing method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the motion blurring processing method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Image pickup apparatus that performs close-up shooting and method of controlling the same
CN103259974A
Video data processing method and device, computer equipment and storage medium
CN112749613A