Special effects video generation method, device, electronic device and storage medium
By generating a random continuous surface that changes over time as a replacement source, the pixel offset coordinates of the video frame are independently calculated, which solves the problem of special effects video generation in communication restricted environments, and realizes independent special effects video generation and multiple types of information in any environment Special effects support.
Patent Information
- Application Number
- CN202310553182.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2043-05-16
AI Technical Summary
The prior art cannot independently generate special effects videos in an environment with limited communications, and rely on external software and a large amount of storage space to replace source data, so it is impossible to obtain resources corresponding to new special effects.
By generating a random continuous surface that changes over time as a displacement source, and determining the random permutation surface based on the time value of the video frame, the offset coordinates of each pixel are calculated to achieve independent generation of video special effects.
Without relying on external software, it can generate special effects videos independently in any environment, save storage space, and support a variety of special effects generation, such as turbulence replacement, fluctuation replacement, glitches, etc.
Smart Images

Figure CN117729349B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of special effect video generation, and in particular to a special effect video generation method, device, electronic equipment and storage medium. Background Art
[0002] When users upload creative videos on major video platforms, they usually add various special effects to the videos to create unique videos to gain more views and attention. Currently, special effect videos are usually generated using externally provided displacement sources. Specifically, one or more images are provided by the outside world as displacement sources, and the pixels in the video are processed according to the parameters in the images to generate various special effects.
[0003] When the above method needs to generate special effects, the user device initiates a request to the external software to obtain the replacement source data, which requires the user to maintain a communicative operating environment, that is, the above method cannot be applied to scenarios with limited communication. For scenarios with limited communication, the replacement source is currently obtained in advance and stored locally, and then called when used. However, the replacement source is generally a series of image data with a large amount of data, and local storage will take up a lot of storage space. In addition, the stored resources are relatively fixed, and the replacement source resources corresponding to the new special effects cannot be obtained when communication is limited. Summary of the invention
[0004] In order to solve the above-mentioned problems existing in the prior art, the embodiments of the present application provide a special effects video generation method, device, electronic device and storage medium, which can independently generate replacement source data without relying on external software, and then realize the generation of special effects videos in any environment.
[0005] In a first aspect, an embodiment of the present application provides a method for generating a special effects video, the method comprising:
[0006] Generate a random displacement source, wherein the random displacement source is a random continuous surface that changes with time;
[0007] According to the time value corresponding to each frame image in the video, a random displacement surface is determined in the random displacement source;
[0008] Determine the offset coordinates of each pixel in each frame image according to the special effect generation request and the random displacement surface;
[0009] Migrate each pixel to the corresponding offset coordinate to obtain the processed image;
[0010] The processed images corresponding to each frame of the image are reassembled according to the order of each frame of the image in the video to obtain a special effects video of the video.
[0011] In one possible implementation, the random permutation source satisfies the following formula:
[0012]
[0013] Among them, f(x,y) is the random permutation source, t is the time, p i , k i 、a i 、h i ,q i , g i , b i and l i is a random parameter, i and n are integers greater than or equal to 1.
[0014] In a possible implementation, the offset coordinates of each pixel satisfy the following formula:
[0015]
[0016]
[0017] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0018] In a possible implementation, the offset coordinates of each pixel satisfy the following formula:
[0019]
[0020]
[0021] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0022] In a possible implementation, the offset coordinates of each pixel satisfy the following formula:
[0023]
[0024]
[0025] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0026] In a possible implementation, the offset coordinates of each pixel satisfy the following formula:
[0027]
[0028]
[0029] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0030] In a possible implementation, the offset coordinates of each pixel satisfy the following formula:
[0031]
[0032]
[0033] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the randomly permuted surface, c and e are hyperparameters determined by the special effect generation request.
[0034] In a second aspect, an embodiment of the present application provides a special effects video generation device, including:
[0035] A random module, used to generate a random displacement source according to a special effect generation request, wherein the random displacement source is a wave surface that changes with time;
[0036] The special effect module is used to determine a random permutation surface in a random permutation source according to a time value corresponding to each frame of the video, determine an offset coordinate of each pixel in each frame of the video according to a special effect generation request and the random permutation surface, and migrate each pixel to the corresponding offset coordinate to obtain a processed image;
[0037] The generation module is used to reorganize the processed images corresponding to each frame of the image according to the order of each frame of the image in the video to obtain a special effects video of the video.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method of the first aspect.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a computer to execute the method of the first aspect.
[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and is computer-operable to cause the computer to execute the method of the first aspect.
[0041] The implementation of the present application has the following beneficial effects:
[0042] In the implementation mode of the present application, a random continuous surface that changes with time is generated by an algorithm as a displacement source, and based on the time correspondence between each frame image in the video and the displacement source, a random displacement surface corresponding to each frame image is determined in the displacement source. Then, the offset coordinates of each pixel in each frame image are determined by the random displacement surface, and each pixel is offset and displaced, thereby realizing special effects processing of the video. Thus, without relying on external software, the displacement source data can be generated autonomously, and then the turbulent displacement of the video can be realized in any environment. At the same time, by adjusting the generation parameters of the offset coordinates, various effects such as turbulent displacement, wave displacement, burrs, and mirror reflection on the water surface can be realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the implementation modes of the present application, the drawings required for use in the description of the implementation modes will be briefly introduced below. Obviously, the drawings described below are some implementation modes of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 A schematic diagram of the hardware structure of a special effects video generation device provided in an embodiment of the present application;
[0045] Figure 2 A flowchart of a special effects video generation method provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of a random permutation source provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of a special effect provided in an embodiment of the present application;
[0048] Figure 5 A schematic diagram of another special effect provided in an embodiment of the present application;
[0049] Figure 6 A schematic diagram of another special effect provided in an embodiment of the present application;
[0050] Figure 7 A schematic diagram of another special effect provided in an embodiment of the present application;
[0051] Figure 8 A functional module composition block diagram of a special effects video generation device provided in an embodiment of the present application;
[0052] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "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 limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0055] Reference to "embodiment" herein means that a particular feature, result, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0056] See also Figure 1 , Figure 1 The hardware structure diagram of a special effect video generation device provided in the embodiment of the present application is as follows: The special effect video generation device 100 includes at least one processor 101 , a communication line 102 , a memory 103 and at least one communication interface 104 .
[0057] In this embodiment, the processor 101 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0058] The communication link 102 may include a path to transmit information between the above components.
[0059] The communication interface 104 may be any transceiver-like device (eg, antenna, etc.) for communicating with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc.
[0060] The memory 103 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0061] In this embodiment, the memory 103 can exist independently and be connected to the processor 101 via the communication line 102. The memory 103 can also be integrated with the processor 101. The memory 103 provided in the embodiment of the present application can generally be non-volatile. Among them, the memory 103 is used to store computer-executable instructions for executing the scheme of the present application, and the execution is controlled by the processor 101. The processor 101 is used to execute the computer-executable instructions stored in the memory 103, so as to implement the method provided in the following embodiment of the present application.
[0062] In an optional implementation, the computer-executable instructions may also be referred to as application code, which is not specifically limited in this application.
[0063] In an optional embodiment, the processor 101 may include one or more CPUs, such as Figure 1 CPU0 and CPU1 in.
[0064] In an optional implementation, the special effect video generating device 100 may include multiple processors, such as Figure 11 and 107. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0065] In an optional embodiment, if the special effects video generating device 100 is a server, for example, it can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Then the special effects video generating device 100 can also include an output device 105 and an input device 106. The output device 105 communicates with the processor 101 and can display information in a variety of ways. For example, the output device 105 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 106 communicates with the processor 101 and can receive user input in a variety of ways. For example, the input device 106 can be a mouse, a keyboard, a touch screen device or a sensor device.
[0066] The special effect video generation device 100 may be a general device or a special device. The embodiment of the present application does not limit the type of the special effect video generation device 100.
[0067] Hereinafter, a special effects video generation method disclosed in this application will be described in detail.
[0068] See also Figure 2 , Figure 2 A flowchart of a special effects video generation method provided in an embodiment of the present application. The special effects video generation method comprises the following steps:
[0069] 201: Generate a random permutation source.
[0070] In this embodiment, the random permutation source is a random continuous surface that changes with time. Specifically, the random permutation source satisfies the following formula:
[0071]
[0072] Among them, f(x,y) is the random permutation source, t is the time, pi , k i 、a i 、h i ,q i , g i , b i and l i is a random parameter, i and n are integers greater than or equal to 1.
[0073] Exemplarily, the random permutation source may be:
[0074] f(x,y)=0.3sin(17.5x+4.0-0.8t)+0.2sin(16.8y+0.7-1.0t)+0.2sin(12.2x+1.0+ 0.3t)+0.1sin(13.0y+2.9+0.4t)+0.4sin(9.50x+9.0-0.9t)+0.3sin(9.80y+9.9-1. 1t)+0.2sin(8.20x+8.0+0.8t)+0.4sin(7.80y+9.7+0.9t)+0.6sin(3.20x+4.0-0.4 t)+0.1sin(4.80y+3.7-0.3t)+0.4sin(2.00x+6.0+1.2t)+0.3sin(2.80y+2.7+0.1t)
[0075] Thus, the obtained random continuous surface is as follows Figure 3 shown.
[0076] 202: Determine a random displacement surface in a random displacement source according to a time value corresponding to each frame image in the video.
[0077] In this implementation, the time value corresponding to each frame of image may be substituted into the formula of the random permutation source in step 201 to obtain the random permutation surface corresponding to the frame of image.
[0078] 203: Determine the offset coordinates of each pixel in each frame image according to the special effect generation request and the random permutation surface.
[0079] In this embodiment, the offset coordinates of each pixel satisfy the following formula:
[0080]
[0081]
[0082] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0083] In this implementation, in order to simplify the algorithm and save computing power, the offset coordinates of each pixel may also satisfy the following formula:
[0084]
[0085]
[0086] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0087] Therefore, the offset coordinates are equal to the original coordinates plus the derivative value, so the greater the slope of the displacement source at the pixel coordinates, the greater the derivative, and the farther the new coordinates of the pixel are from the original coordinates, and vice versa for smaller slopes. The displacement source is a random waveform with varying slopes, so different pixels will get different degrees of displacement, producing a wave-like distortion effect.
[0088] In this embodiment, by changing the e value in the above two pairs of formulas, the special effect of scaling the waveform of the replacement source can be achieved, as shown in the following example: Figure 4 shown.
[0089] In this implementation, other special effects may be achieved by changing the formula of the offset coordinates. For example, the offset coordinates of each pixel may satisfy the following formula:
[0090]
[0091]
[0092] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0093] Similarly, the above formula can be simplified to:
[0094]
[0095]
[0096] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0097] In this embodiment, by changing the e value in the above two pairs of formulas, the special effect of displacement distortion of the waveform of the displacement source can be achieved, as shown in the following example: Figure 5 shown.
[0098] In this embodiment, the above four pairs of formulas can also be superimposed to simultaneously obtain Figure 6 The effects of scaling and displacement distortion are shown as follows:
[0099]
[0100]
[0101] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the randomly permuted surface, c and e are hyperparameters determined by the special effect generation request.
[0102] In addition, in this embodiment, various special effects can be achieved by adjusting the relevant parameters in the random displacement source and the offset coordinate formula. For example, in the formula for generating and adjusting the random displacement source, the variable t is multiplied by a coefficient to adjust the playback speed. The larger the coefficient, the more obvious the change of the waveform over time. Or, in the offset coordinate formula, the coordinate is multiplied by a coefficient before the corresponding pixel coordinate is differentiated. This is equivalent to the generated smooth surface being scaled by a larger coefficient, which is equivalent to the displacement source being like Figure 7 The pattern generally becomes denser, creating a glitch effect.
[0103] In this implementation, multiple segmented derivations may also be used to improve the precision of special effects. Specifically, for the original offset coordinate formula:
[0104]
[0105] The formula can be changed to:
[0106]
[0107]
[0108] ………
[0109]
[0110] Among them, m represents the number of pixels in each frame image.
[0111] In this embodiment, the various parameters mentioned above can be set by developers according to different special effects during development and then sealed as different special effects packages. Then, when using, the user only needs to click on the desired special effect to generate the corresponding special effect generation request. The special effect generation request then calls the parameters in the corresponding special effect package to generate the special effect. Therefore, compared with the current practice of storing the replacement source corresponding to the special effect, the method provided in this application only needs to store the corresponding special effect package parameters, which greatly saves the storage space.
[0112] 204: Migrate each pixel to the corresponding offset coordinate to obtain a processed image.
[0113] In this embodiment, by migrating each pixel point to its corresponding offset coordinate, a processed image including special effects can be obtained.
[0114] 205: Reorganize the processed images corresponding to each frame of the image according to the order of each frame of the image in the video to obtain a special effects video of the video.
[0115] In summary, in the special effects video generation method provided by the present invention, a random continuous surface that changes with time is generated by an algorithm as a displacement source, and based on the time correspondence between each frame image in the video and the displacement source, a random displacement surface corresponding to each frame image is determined in the displacement source. Then, the offset coordinates of each pixel in each frame image are determined through the random displacement surface, and each pixel is offset and displaced, thereby realizing special effects processing of the video. In this way, the displacement source data can be generated autonomously without relying on external software, and then the turbulent displacement of the video can be realized under any environment. At the same time, by adjusting the generation parameters of the offset coordinates, various effects such as turbulent displacement, wave displacement, burrs, and mirror reflection on the water surface can be realized.
[0116] See also Figure 8 , Figure 8 This is a functional module block diagram of a special effects video generation device provided in an embodiment of the present application. Figure 3 As shown, the special effect video generating device 800 includes:
[0117] A random module 801 is used to generate a random permutation source, wherein the random permutation source is a random continuous surface that changes with time;
[0118] The special effect module 802 is used to determine a random permutation surface in a random permutation source according to a time value corresponding to each frame of the video, determine an offset coordinate of each pixel in each frame of the video according to the special effect generation request and the random permutation surface, and migrate each pixel to the corresponding offset coordinate to obtain a processed image;
[0119] The generation module 803 is used to reorganize the processed images corresponding to each frame of the image according to the order of each frame of the image in the video to obtain a special effects video of the video.
[0120] In an embodiment of the present invention, the random permutation source satisfies the following formula:
[0121]
[0122] Among them, f(x,y) is the random permutation source, t is the time, p i , k i 、a i 、h i ,q i , g i 、b i and l i is a random parameter, i and n are integers greater than or equal to 1.
[0123] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0124]
[0125]
[0126] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0127] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0128]
[0129]
[0130] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0131] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0132]
[0133]
[0134] Among them, x new and newis the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0135] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0136]
[0137]
[0138] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0139] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0140]
[0141]
[0142] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the randomly permuted surface, c and e are hyperparameters determined by the special effect generation request.
[0143] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig. 9 As shown, the electronic device 900 includes a transceiver 901, a processor 902 and a memory 903. They are connected via a bus 904. The memory 903 is used to store computer programs and data, and can transmit the data stored in the memory 903 to the processor 902.
[0144] The processor 902 is used to read the computer program in the memory 903 and perform the following operations:
[0145] Generate a random displacement source, wherein the random displacement source is a random continuous surface that changes with time;
[0146] According to the time value corresponding to each frame image in the video, a random displacement surface is determined in the random displacement source;
[0147] Determine the offset coordinates of each pixel in each frame image according to the special effect generation request and the random displacement surface;
[0148] Migrate each pixel to the corresponding offset coordinate to obtain the processed image;
[0149] The processed images corresponding to each frame of the image are reassembled according to the order of each frame of the image in the video to obtain a special effects video of the video.
[0150] In an embodiment of the present invention, the random permutation source satisfies the following formula:
[0151]
[0152] Among them, f(x,y) is the random permutation source, t is the time, p i , k i 、a i 、h i ,q i , g i 、b i and l i is a random parameter, i and n are integers greater than or equal to 1.
[0153] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0154]
[0155]
[0156] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0157] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0158]
[0159]
[0160] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0161] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0162]
[0163]
[0164] Among them, x new and newis the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0165] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0166]
[0167]
[0168] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the random permutation surface, and e is the hyperparameter determined by the special effect generation request.
[0169] In an embodiment of the present invention, the offset coordinates of each pixel satisfy the following formula:
[0170]
[0171]
[0172] Among them, x new and new is the offset coordinate of each pixel, j(x,y) is the randomly permuted surface, c and e are hyperparameters determined by the special effect generation request.
[0173] It should be understood that the special effects video generation device in the present application may include a smart phone (such as an Android phone, an iOS phone, a Windows Phone phone, etc.), a tablet computer, a PDA, a laptop computer, a mobile Internet device MID (Mobile Internet Devices, referred to as: MID), a robot or a wearable device, etc. The above-mentioned special effects video generation device is only an example, not an exhaustive list, including but not limited to the above-mentioned special effects video generation device. In practical applications, the above-mentioned special effects video generation device may also include: an intelligent vehicle terminal, a computer device, etc.
[0174] Through the description of the above implementation modes, those skilled in the art can clearly understand that the present invention can be implemented by combining software with a hardware platform. Based on such an understanding, all or part of the contribution of the technical solution of the present invention to the background technology can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various implementation modes of the present invention or some parts of the implementation modes.
[0175] Therefore, the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement some or all of the steps of any special effect video generation method described in the above method implementation. For example, the storage medium may include a hard disk, a floppy disk, an optical disk, a tape, a disk, a USB flash drive, a flash memory, etc.
[0176] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any special effects video generation method recorded in the above method implementation.
[0177] It should be noted that, for the sake of simplicity, the aforementioned method implementations are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the implementations described in the specification are all optional implementations, and the actions and modules involved are not necessarily required by the present application.
[0178] In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0179] In the several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device implementation described above is only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0180] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0181] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software program module.
[0182] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, in essence, 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, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0183] A person skilled in the art may understand that all or part of the steps in the various methods of the above-mentioned embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0184] The above is a detailed introduction to the implementation methods of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above implementation methods is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A special effects video generation method, characterized in that: The method comprises: Generate a random permutation source, wherein the random permutation source is a random continuous surface that changes with time; Determine a random permutation surface in the random permutation source according to a time value corresponding to each frame of the image in the video; The offset coordinates of each pixel in each frame of the image are determined according to the special effect generation request and the random permutation surface; the offset coordinates of each pixel satisfy the following formula: Among them, x new and new is the offset coordinate of each pixel, j(x, y) is the random permutation surface, c and e are hyperparameters determined by the special effect generation request, and x and y are the pixel coordinates of each pixel respectively; Migrating each pixel to a corresponding offset coordinate to obtain a processed image; The processed images corresponding to each frame of the image are reorganized according to the order of each frame of the image in the video to obtain a special effects video of the video.
2. The method according to claim 1, characterized in that The random permutation source satisfies the following formula: Where f(x,y) is the random permutation source, t is the time, p i , k i 、a i 、h i ,q i , g i , b i and l i is a random parameter, i and n are integers greater than or equal to 1.
3. A special effects video generation device, characterized in that: The device comprises: A random module, used to generate a random permutation source, wherein the random permutation source is a random continuous surface that changes with time; The special effects module is used to determine a random permutation surface in the random permutation source according to the time value corresponding to each frame of the video, determine the offset coordinates of each pixel in each frame of the video according to the special effects generation request and the random permutation surface, and migrate each pixel to the corresponding offset coordinates to obtain a processed image, wherein the offset coordinates of each pixel satisfy the following formula: Among them, x new and new is the offset coordinate of each pixel, j(x, y) is the random permutation surface, c and e are hyperparameters determined by the special effect generation request, and x and y are the pixel coordinates of each pixel respectively; The generation module is used to reorganize the processed images corresponding to each frame of the image according to the order of each frame of the image in the video to obtain a special effects video of the video.
4. An electronic device, characterized in that: The method comprises a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the one or more programs include instructions for executing the steps in the method described in claim 1 or 2.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to claim 1 or 2.
Citation Information
Patent Citations
Image synthesis method and device and computer readable storage medium
CN110070515A
Water ripple special effect video generation method and device, electronic equipment and storage medium
CN113645414A