Method for realizing rotation and distortion video transition special effects and related equipment
By acquiring image frames in the video transition effects, performing rotation and distortion processing and blur and smoothing, the problems of jagging and molar patterns in the prior art are solved, and the visual effect of the video transition effects is improved.
Patent Information
- Application Number
- CN202210906543.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-07-29
AI Technical Summary
Existing video transition effects are prone to jagging and molar patterns when complex movements change, resulting in poor visual effects.
By obtaining the image frame of the video clip, determining the center point position and range radius, rotating and blurring each pixel point to form a rotating twisted video transition effect.
It realizes a visual effect without jagging and moiré, and improves the visual quality of the video transition special effects.
Smart Images

Figure CN115334254B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video editing, and in particular to a method for realizing a rotation and distortion video transition special effect and related equipment. Background Art
[0002] Nowadays, auxiliary special effects are common in video production. For example, they are used in the editing of movies and in the editing process of short videos shared by people. Transitions are one of the most common special effects. Transitions are the process of transitioning from one scene to the next. There are many types of transition effects available, but most existing transition effects are based on regular motion changes. For complex motion changes, existing transition effects often suffer from aliasing and moiré issues, resulting in poor transition effects and failing to meet user needs.
[0003] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention
[0004] The main purpose of the present invention is to provide a solution for realizing transition effects based on rotation distortion, which will not cause jagged or moiré patterns in the video and has a better visual perception.
[0005] A first aspect of the present invention provides a method for implementing a rotation and distortion video transition effect, the method comprising:
[0006] Get the video clip for which you want to create a rotation and distortion video transition effect;
[0007] intercepting a plurality of image frames at the head or tail of the video clip;
[0008] Determining a center point position of the rotation and distortion video transition effect in each of the image frames and a range radius of the rotation and distortion video transition effect;
[0009] Acquire all pixel points within the range radius of each image frame;
[0010] Rotate all the pixels within the range radius of each image frame with the center point as the center, wherein the farther the pixel is from the center point, the smaller the rotation angle of the pixel;
[0011] Performing fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change, to obtain a plurality of target image frames with the rotational distortion video transition effect;
[0012] A plurality of the target image frames are re-inserted into the video clip in the original order to obtain a video clip with the rotation and distortion video transition effect.
[0013] In an optional implementation manner of the first aspect of the present invention, rotating all the pixels within the range radius of each image frame about the center point position includes:
[0014] Establishing a two-dimensional coordinate system with the center point as the origin;
[0015] Obtaining the initial coordinates (X, Y) of each pixel point in the two-dimensional coordinate system;
[0016] By formula Calculate the rotation angle of each pixel point, where Sr is the rotation angle, S is the set angle, and r is the range radius of the rotation and distortion video transition effect;
[0017] Each pixel point is rotated and moved based on the rotation angle with the center point position as the center of the circle.
[0018] In an optional implementation of the first aspect of the present invention, obtaining the initial coordinates of each pixel point in the two-dimensional coordinate system includes:
[0019] For any pixel point, taking any corner of the image frame as the origin, obtain the first row and column coordinates (a, b) of the center point position in the image frame and the second row and column coordinates (c, d) of the pixel point in the image frame;
[0020] The initial coordinates (X, Y) of the pixel point in the two-dimensional coordinate system are calculated based on the first row and column coordinates (a, b) and the second row and column coordinates (c, d), where X=ca, Y=db.
[0021] In an optional implementation manner of the first aspect of the present invention, the rotating movement of each pixel point based on the rotation angle and taking the center point position as the center of the circle includes:
[0022] For any of the pixel points, based on the rotation angle Sr, the target coordinates (Sx, Sy) of the pixel point in the two-dimensional coordinate system are calculated, where Sx = X*cos(Sr)-Y*sin(Sr), Sy = X*sin(Sr)-Y*cos(Sr);
[0023] Then, the target coordinates (Sx, Sy) are converted into the third row and column coordinates (e, f), where e = Sx + a, f = Sy + b;
[0024] The pixel point is moved from the second row and column coordinates (c, d) to the third row and column coordinates (e, f) to complete the rotational movement of the pixel point.
[0025] In an optional implementation manner of the first aspect of the present invention, the performing fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change includes:
[0026] For any pixel point within the range radius of each image frame, obtaining a pixel value of the pixel point and pixel values corresponding to eight surrounding pixel points surrounding the pixel point;
[0027] Calculate the average of the sum of the pixel values of the pixel point and the eight surrounding pixel points, and use the average as the pixel value of the pixel point after fuzzy smoothing processing.
[0028] In an optional implementation of the first aspect of the present invention, in a plurality of the image frames, the range radius of the rotation and distortion video transition effect gradually increases based on the timestamps of the image frames.
[0029] In an optional implementation of the first aspect of the present invention, in a plurality of the image frames, the center position of the rotation and distortion video transition effect moves linearly.
[0030] A second aspect of the present invention provides a device for implementing a rotation and distortion video transition effect, the device comprising:
[0031] The video clip acquisition module is used to obtain the video clips needed to produce the rotation and distortion video transition effects;
[0032] An image frame interception module, configured to intercept a number of image frames at the head or tail of the video clip;
[0033] A parameter determination module determines a center point position of the rotation and distortion video transition effect in each of the image frames and a range radius of the rotation and distortion video transition effect;
[0034] A pixel point acquisition module, configured to acquire all pixel points within the range radius of each image frame;
[0035] a rotation change module, configured to rotate all the pixel points within the range radius of each image frame with the center point as the center of the circle, wherein the farther the pixel point is from the center point, the smaller the rotation angle of the pixel point;
[0036] a fuzzy processing module, configured to perform fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change, so as to obtain a plurality of target image frames having the rotational distortion video transition effect;
[0037] The video segment reassembly module is used to reinsert a number of the target image frames into the video segment in the original order to obtain a video segment with the rotation and distortion video transition effect.
[0038] A third aspect of the present invention provides a device for implementing a rotation and distortion video transition special effect, the device comprising: a memory and at least one processor, the memory storing instructions, the memory and the at least one processor being interconnected via a circuit;
[0039] The at least one processor calls the instructions in the memory to enable the device for implementing the rotation and distortion video transition special effect to execute any one of the above methods for implementing the rotation and distortion video transition special effect.
[0040] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for realizing the rotation and distortion video transition effect as described in any one of the above items is implemented.
[0041] Beneficial effects: The present invention provides a method for realizing a rotation and distortion video transition special effect and related equipment, the method comprising: obtaining a video clip; intercepting and obtaining a plurality of image frames; determining the center point position and range radius of the rotation and distortion video transition special effect; obtaining and rotating all the pixel points within the range radius of each image frame with the center point position as the center of the circle, wherein the farther the pixel point is from the center point position, the smaller the rotation angle; performing fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change to obtain a plurality of target image frames; reinserting the plurality of target image frames into the video clip in the original order to obtain a video clip with the rotation and distortion video transition special effect. The method of the present invention uses the image frames of the video clip as the carrier of the transition special effect, does not increase the volume of the video after adding the special effect, and the distorted pixels after the change will be fuzzy smoothed, without jagged edges, and have a better viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of an embodiment of a method for realizing a rotation and distortion video transition effect according to the present invention;
[0043] Figure 2 A schematic diagram of an embodiment of a device for realizing a rotation and distortion video transition effect according to the present invention;
[0044] Figure 3 The present invention is a schematic diagram of an embodiment of a device for realizing a rotation and distortion video transition effect. DETAILED DESCRIPTION
[0045] An embodiment of the present invention provides a method for implementing a rotation and distortion video transition effect and related equipment. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0046] See Figure 1 A first aspect of the present invention provides a method for implementing a rotation and distortion video transition effect, the method comprising:
[0047] S100, obtaining a video clip for which a rotation and distortion video transition effect is to be produced; generally speaking, an edited video is composed of multiple video clips, and a transition effect is generally set at the joining position of two video clips;
[0048] S200, intercepting several image frames at the head or tail of the video clip; transition effects are generally set at the head or tail of a video clip, so when adding transition effects, they need to be added to the image frames at the head or tail of the video clip. The number of image frames to which the transition effects need to be added depends on the required duration of the transition effects and the playback frame rate of the video clip; the special effects in the present invention are directly created on the image frames, if the size of the video clip is not significantly increased;
[0049] S300, determining the center point position of the rotation and distortion video transition effect in each of the image frames and the range radius of the rotation and distortion video transition effect; in the present invention, in order to obtain a better viewing experience, the position of the rotation and distortion video transition effect on each image frame is variable, that is, the center point position in each of the image frames is different. Exemplarily, in several of the image frames, the center position of the rotation and distortion video transition effect moves linearly. For example, in the first image frame, the row and column coordinates of the center position of the rotation and distortion video transition effect are the second row and second column; in the second image frame, the row and column coordinates of the center position of the rotation and distortion video transition effect are the fifth row and fifth column; in the third image frame, the row and column coordinates of the center position of the rotation and distortion video transition effect are the tenth row and tenth column. In another embodiment, the center point position of the rotation and distortion video transition effect in each of the image frames may also change in a curve;
[0050] At the same time, the range radius of the rotation and distortion video transition effect on each image frame also changes. For example, in several image frames, the range radius of the rotation and distortion video transition effect gradually increases based on the timestamp of the image frame. Alternatively, it may decrease. The gradual increase or decrease may be based on a certain ratio. The software program provided by the solution of the present invention can provide different modes for users to choose.
[0051] S400, acquiring all pixels within the range radius of each image frame; in the present invention, rotational distortion only changes all pixels within the range radius of the image frame, while pixels outside the range radius remain unchanged;
[0052] S500: Rotate all the pixels within the range radius of each image frame with the center point as the center, wherein the farther the pixel is from the center point, the smaller the rotation angle of the pixel is. In another optional embodiment of the present invention, the farther the pixel is from the center point, the larger the rotation angle of the pixel is, thereby achieving different distortion effects.
[0053] S600: Performing blurring and smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change, thereby obtaining a plurality of target image frames having the rotational distortion video transition effect. In the present invention, if only the pixel position is simply moved, there may be certain aliasing or moiré patterns between the pixels after the movement, so the present invention also requires blurring and smoothing processing on the pixel values after the pixel points are moved.
[0054] S700: Reinserting the plurality of target image frames into the video clip in their original order to obtain a video clip having the twirl video transition effect. Finally, the plurality of target image frames having the twirl video transition effect, which are produced by the plurality of image frames at the head or tail of the video clip of the present invention, are placed back into the head or tail of the video clip in their original order to reassemble the video clip into a complete video clip.
[0055] In an optional implementation manner of the first aspect of the present invention, rotating all the pixels within the range radius of each image frame about the center point position includes:
[0056] Establishing a two-dimensional coordinate system with the center point as the origin; in this step, the two-dimensional coordinate system is established with the pixel point at the center point;
[0057] Obtaining the initial coordinates (X, Y) of each pixel point in the two-dimensional coordinate system; after the two-dimensional coordinate system is established, it is necessary to obtain the coordinate system coordinates of each pixel point in the two-dimensional coordinate system according to the row and column information of each pixel point; specifically, this step is to, for any pixel point, first use any corner of the image frame as the origin, for example, use the lower left corner of the image frame as the origin, obtain the first row and column coordinates (a, b) of the center point position in the image frame and the second row and column coordinates (c, d) of the pixel point in the image frame; then, based on the first row and column coordinates (a, b) and the second row and column coordinates (c, d), calculate the initial coordinates (X, Y) of the pixel point in the two-dimensional coordinate system, where X=ca, Y=db;
[0058] Then through the formula Calculate the rotation angle of each pixel point, where Sr is the rotation angle, S is a set angle (an angle value set manually, which can be the same or different in different image frames), and r is the range radius of the rotation and distortion video transition effect;
[0059] Finally, the center point position is used as the center of the circle and each pixel point is rotated and moved based on the rotation angle. Specifically, this step is: for any pixel point, based on the rotation angle Sr, first calculate the target coordinates (Sx, Sy) of the pixel point in the two-dimensional coordinate system, where Sx = X*cos(Sr)-Y*sin(Sr), Sy = X*sin(Sr)-Y*cos(Sr); then convert the target coordinates (Sx, Sy) into the third row and column coordinates (e, f), where e = Sx+a, f = Sy+b; and according to the pixel point, move from the second row and column coordinates (c, d) to the third row and column coordinates (e, f) to complete the rotation movement of the pixel point.
[0060] As is well known, a video is composed of many frames of images, and an image is composed of many rows and columns of pixel values. The method of the present invention is to rotate each pixel on the image to another position according to a certain angle and rearrange the pixels to obtain a chaotic image. This image will definitely have many jagged edges. The second step of the present invention is to deal with the jagged edge problem. In an optional implementation of the first aspect of the present invention, it is necessary to perform fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change. Exemplarily, the fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change includes:
[0061] For any pixel point within the range radius of each image frame, obtaining a pixel value of the pixel point and pixel values corresponding to eight surrounding pixel points surrounding the pixel point;
[0062] Calculate the average of the sum of the pixel values of the pixel point and the eight surrounding pixel points, and use the average as the pixel value of the pixel point after fuzzy smoothing processing.
[0063] In general, the complete process steps and principles of the method for implementing the rotation and distortion video transition effect of the present invention can be summarized as follows:
[0064] 1. Coordinate pixel positions
[0065] Each pixel on an image has a position on the image, assuming it is (clos, rows), where clos represents the number of pixel columns and rows represents the number of pixel rows. To facilitate calculations, we can set a coordinate origin, assuming that the number of columns of the coordinate origin on the image is clo, and the number of columns on the image is row. The position of each pixel is converted based on this coordinate origin. The calculation method for converting the pixel position to coordinates (x, y) is as follows: x = clos - clo, y = rows - row;
[0066] 2. Rotate pixel coordinates
[0067] Generally, for a coordinate point (a, b) rotated around the origin by angle k, the coordinates (c, d) are calculated as follows: c = a*cos(k) - b*sin(k), d = a*sin(k) + b*cos(k);
[0068] Therefore, the calculation method is the same for rotating all pixel coordinates separately. Assuming the initial rotation angle is s, in order to achieve controllability, the range radius of the rotation change is set to r. No rotation is performed for places beyond the radius r from the origin, that is, the rotation angle is zero. According to the pixel coordinates obtained in step 1, the relationship between the actual rotation angle (assuming it is sr) and the radius r can be obtained as follows:
[0069] sr=s*(1.0-((x 2 +y 2 ) 1 / 2 ) / r), this formula indicates that the farther from the center, the smaller the rotation angle. It should be noted that if sr is less than 0, then it is only 0 and cannot be a negative value.
[0070] Next, according to the rotation formula, the rotated pixel coordinates (sx, sy) can be calculated as follows:
[0071] sx=x*cos(sr)-y*sin(sr)
[0072] sy=x*sin(sr)+y*cos(sr)
[0073] This completes the rotation.
[0074] 3. Convert pixel coordinates back to the position on the image
[0075] The previous step has obtained the rotated pixel coordinates (sx, sy). This coordinate is in the established coordinate system. Reading the pixel point requires the position information of the pixel on the image, so this time it needs to be converted into the pixel position (clos', rows'): clos' = sx + clo, rows' = sy + row;
[0076] 4. Blur and smooth the image to eliminate aliasing
[0077] In the previous step, the pixel position of the rotated image has been obtained, and the pixel point can be obtained from the image. However, the rotated image is bound to have aliasing and burrs, which greatly affects the appearance. Based on the principle that blurring and smoothing an image can eliminate aliasing, you can consider blurring. If you blur the image obtained after the above rotation, the blurred image will have a certain degree of blurriness and may not be clear. This will blur the entire image to eliminate aliasing, which is not the desired result. Therefore, a solution here is to integrate blurring into the rotation change, so that the aliasing caused by the change can be eliminated during the rotation change without affecting the image quality.
[0078] Generally, there are many ways to blur an image. Here we only take the simplest method, mean blur: for each pixel, its pixel value is the average of the pixel values of the nine pixels in the nine-square grid centered on it, and the mean blur is completed.
[0079] Therefore, here, we can get the position of the pixel on the image (clos', rows') through the previous step, and get the pixel positions in the nine-square grid centered on it as follows: (clos'-1, rows'-1), (clos', rows'-1), (clos'+1, rows'-1), (clos'-1, rows')(clos', rows')(clos'+1, rows')(clos'-1, rows'+1), (clos', rows'+1), (clos'+1, rows'+1); take the pixel values of these 9 positions respectively and then average them to achieve the purpose of using blur to eliminate aliasing.
[0080] See also Figure 2 A second aspect of the present invention provides a device for implementing a rotation and distortion video transition effect, the device comprising:
[0081] The video clip acquisition module 10 is used to acquire the video clip for producing the rotation and distortion video transition effect;
[0082] An image frame interception module 20 is used to intercept several image frames at the head or tail of the video clip;
[0083] The parameter determination module 30 determines the center point position of the rotation and distortion video transition effect in each of the image frames and the range radius of the rotation and distortion video transition effect;
[0084] A pixel point acquisition module 40 is used to acquire all pixel points within the range radius of each image frame;
[0085] a rotation changing module 50, configured to rotate all the pixels within the range radius of each image frame with the center point as the center, wherein the farther the pixel is from the center point, the smaller the rotation angle of the pixel;
[0086] A fuzzy processing module 60 is used to perform fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change, so as to obtain a plurality of target image frames with the rotational distortion video transition effect;
[0087] The video segment reassembly module 70 is configured to re-insert the target image frames into the video segment in their original order to obtain a video segment with the rotation and distortion video transition effect.
[0088] In an optional implementation manner of the second aspect of the present invention, rotating all the pixels within the range radius of each image frame about the center point position includes:
[0089] Establishing a two-dimensional coordinate system with the center point as the origin;
[0090] Obtaining the initial coordinates (X, Y) of each pixel point in the two-dimensional coordinate system;
[0091] By formula Calculate the rotation angle of each pixel point, where Sr is the rotation angle, S is the set angle, and r is the range radius of the rotation and distortion video transition effect;
[0092] Each pixel point is rotated and moved based on the rotation angle with the center point position as the center of the circle.
[0093] In an optional implementation of the second aspect of the present invention, obtaining the initial coordinates of each pixel point in the two-dimensional coordinate system includes:
[0094] For any pixel point, taking any corner of the image frame as the origin, obtain the first row and column coordinates (a, b) of the center point position in the image frame and the second row and column coordinates (c, d) of the pixel point in the image frame;
[0095] The initial coordinates (X, Y) of the pixel point in the two-dimensional coordinate system are calculated based on the first row and column coordinates (a, b) and the second row and column coordinates (c, d), where X=ca, Y=db.
[0096] In an optional implementation manner of the second aspect of the present invention, the rotating movement of each pixel point based on the rotation angle and taking the center point position as the center of the circle includes:
[0097] For any of the pixel points, based on the rotation angle Sr, the target coordinates (Sx, Sy) of the pixel point in the two-dimensional coordinate system are calculated, where Sx = X*cos(Sr)-Y*sin(Sr), Sy = X*sin(Sr)-Y*cos(Sr);
[0098] Then, the target coordinates (Sx, Sy) are converted into the third row and column coordinates (e, f), where e = Sx + a, f = Sy + b;
[0099] The pixel point is moved from the second row and column coordinates (c, d) to the third row and column coordinates (e, f) to complete the rotational movement of the pixel point.
[0100] In an optional implementation of the second aspect of the present invention, the performing fuzzy smoothing on the pixel values of each pixel point within the range radius of each image frame after the rotation change includes:
[0101] For any pixel point within the range radius of each image frame, obtaining a pixel value of the pixel point and pixel values corresponding to eight surrounding pixel points surrounding the pixel point;
[0102] Calculate the average of the sum of the pixel values of the pixel point and the eight surrounding pixel points, and use the average as the pixel value of the pixel point after fuzzy smoothing processing.
[0103] In an optional implementation of the second aspect of the present invention, in a plurality of the image frames, the range radius of the rotation and distortion video transition effect gradually increases based on the timestamps of the image frames.
[0104] In an optional implementation of the second aspect of the present invention, in a plurality of the image frames, the center position of the rotation and distortion video transition effect moves linearly.
[0105] Figure 31 is a schematic structural diagram of a device for implementing a rotation and distortion video transition special effect provided by an embodiment of the present invention. The device for implementing the rotation and distortion video transition special effect may have relatively large differences due to different configurations or performances, and may include one or more processors 80 (central processing units, CPU) (for example, one or more processors) and a memory 90, and one or more storage media 100 for storing application programs or data (for example, one or more massive storage devices). The memory and the storage medium may be temporary storage or permanent storage. The program stored in the storage medium may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the device for implementing the rotation and distortion video transition special effect. Furthermore, the processor may be configured to communicate with the storage medium to execute a series of instruction operations in the storage medium on the device for implementing the rotation and distortion video transition special effect.
[0106] The device for implementing the rotation and distortion video transition effect of the present invention may further include one or more power supplies 110, one or more wired or wireless network interfaces 120, one or more input and output interfaces 130, and / or one or more operating systems, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be understood by those skilled in the art that Figure 3 The structure of the device for implementing the rotation and distortion video transition effect shown does not constitute a specific limitation on the device for implementing the rotation and distortion video transition effect of the present invention, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0107] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are run on a computer, the computer executes the steps of the method for implementing the rotation and distortion video transition special effects.
[0108] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0109] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc., various media that can store program code.
[0110] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for realizing a rotation and distortion video transition effect, characterized in that: The method for realizing the rotation and distortion video transition special effect includes: Get the video clip for which you want to create a rotation and distortion video transition effect; intercepting a plurality of image frames at the head or tail of the video clip; Determining a center point position of the rotation and distortion video transition effect in each of the image frames and a range radius of the rotation and distortion video transition effect; Acquire all pixel points within the range radius of each image frame; Rotate all the pixels within the range radius of each image frame with the center point as the center, wherein the farther the pixel is from the center point, the smaller the rotation angle of the pixel; Performing fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change, to obtain a plurality of target image frames with the rotational distortion video transition effect; Re-inserting a plurality of the target image frames into the video clip in the original order to obtain a video clip with the rotation and distortion video transition effect; The rotating change of all the pixel points within the range radius of each image frame with the center point position as the circle center includes: Establishing a two-dimensional coordinate system with the center point as the origin; Obtaining the initial coordinates (X, Y) of each pixel point in the two-dimensional coordinate system; By formula Calculating a rotation angle of each pixel, where Sr is the rotation angle, S is a set angle, and r is a range radius of the rotation and distortion video transition effect, and in a plurality of the image frames, the range radius of the rotation and distortion video transition effect gradually increases based on the timestamps of the image frames; Each pixel point is rotated and moved based on the rotation angle with the center point as the center of the circle, so that in a plurality of the image frames, the center position of the rotational distortion video transition effect moves linearly; The performing fuzzy smoothing on the pixel values of each pixel point within the range radius of each image frame after the rotation change comprises: For any pixel point within the range radius of each image frame, obtaining a pixel value of the pixel point and pixel values corresponding to eight surrounding pixel points surrounding the pixel point; Calculate the average of the sum of the pixel values of the pixel point and the eight surrounding pixel points, and use the average as the pixel value of the pixel point after fuzzy smoothing processing.
2. The method for realizing the rotation and distortion video transition effect according to claim 1, characterized in that: The obtaining of the initial coordinates of each pixel point in the two-dimensional coordinate system comprises: For any pixel point, taking any corner of the image frame as the origin, obtain the first row and column coordinates (a, b) of the center point position in the image frame and the second row and column coordinates (c, d) of the pixel point in the image frame; The initial coordinates (X, Y) of the pixel point in the two-dimensional coordinate system are calculated based on the first row and column coordinates (a, b) and the second row and column coordinates (c, d), where X=ca, Y=db.
3. The method for realizing the rotation and distortion video transition effect according to claim 2, characterized in that: The rotating movement of each pixel point with the center point as the center and based on the rotation angle includes: For any of the pixel points, based on the rotation angle Sr, the target coordinates (Sx, Sy) of the pixel point in the two-dimensional coordinate system are calculated, where Sx = X*cos(Sr)-Y*sin(Sr), Sy = X*sin(Sr)-Y*cos(Sr); Then, the target coordinates (Sx, Sy) are converted into the third row and column coordinates (e, f), where e = Sx + a, f = Sy + b; The pixel point is moved from the second row and column coordinates (c, d) to the third row and column coordinates (e, f) to complete the rotational movement of the pixel point.
4. A device for realizing a rotation and distortion video transition effect, characterized in that: The device for realizing the rotation and distortion video transition special effect includes: The video clip acquisition module is used to obtain the video clips needed to produce the rotation and distortion video transition effects; An image frame interception module, configured to intercept a number of image frames at the head or tail of the video clip; A parameter determination module determines a center point position of the rotation and distortion video transition effect in each of the image frames and a range radius of the rotation and distortion video transition effect; A pixel point acquisition module, configured to acquire all pixel points within the range radius of each image frame; a rotation change module, configured to rotate all the pixel points within the range radius of each image frame with the center point as the center of the circle, wherein the farther the pixel point is from the center point, the smaller the rotation angle of the pixel point; a fuzzy processing module, configured to perform fuzzy smoothing processing on the pixel values of each pixel point within the range radius of each image frame after the rotation change, so as to obtain a plurality of target image frames having the rotational distortion video transition effect; a video segment reassembly module, configured to re-insert a plurality of target image frames into the video segment in their original order, thereby obtaining a video segment having the rotation and distortion video transition effect; The rotating change of all the pixel points within the range radius of each image frame with the center point position as the circle center includes: Establishing a two-dimensional coordinate system with the center point as the origin; Obtaining the initial coordinates (X, Y) of each pixel point in the two-dimensional coordinate system; By formula Calculating a rotation angle of each pixel, where Sr is the rotation angle, S is a set angle, and r is a range radius of the rotation and distortion video transition effect, and in a plurality of the image frames, the range radius of the rotation and distortion video transition effect gradually increases based on the timestamps of the image frames; Each pixel point is rotated and moved based on the rotation angle with the center point as the center of the circle, so that in a plurality of the image frames, the center position of the rotational distortion video transition effect moves linearly; The performing fuzzy smoothing on the pixel values of each pixel point within the range radius of each image frame after the rotation change comprises: For any pixel point within the range radius of each image frame, obtaining a pixel value of the pixel point and pixel values corresponding to eight surrounding pixel points surrounding the pixel point; Calculate the average of the sum of the pixel values of the pixel point and the eight surrounding pixel points, and use the average as the pixel value of the pixel point after fuzzy smoothing processing.
5. A device for realizing a rotation and distortion video transition effect, characterized in that: The device for implementing the rotation and distortion video transition special effect includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instruction in the memory to enable the device for implementing the rotation and distortion video transition special effect to execute the method for implementing the rotation and distortion video transition special effect according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for realizing the rotation and distortion video transition effect according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Video producing method, video producing device, and communication terminal
CN105516618A
Special effect video synthesis method and device, computer equipment and storage medium
CN111147766A
Image special effect generation method and device, electronic equipment and storage medium
CN114170068A