Video processing method, device and equipment, computer readable storage medium and product
By adjusting the video pixel distribution based on the noise graph normal information and performing blur processing, the problem of single existing video processing methods is solved, diversified glass texture effects are achieved, and the fit and effect of video processing is improved.
Patent Information
- Application Number
- CN202311501638.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2025-05-13
AI Technical Summary
The existing video processing methods are relatively single and cannot meet the actual needs of users.
By obtaining the video to be processed and the target noise map, adjusting the pixel distribution of the video frame based on the normal information of the noise map, and blurring the adjusted video, simulated the refractive effect similar to glass or the material effect of frosted glass.
It realizes diversification of video processing, can simulate the effects of different glass textures, improves the effects of video processing, and makes it more in line with the personalized needs of users.
Smart Images

Figure CN119996775A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular, to a video processing method, apparatus, device, computer-readable storage medium, and product. Background Art
[0002] With the improvement of terminal equipment hardware performance and the continuous advancement of artificial intelligence technology, more and more video processing software has gradually entered the lives of users. Users can edit the collected videos based on video processing software, where editing operations include but are not limited to regular operations such as editing, adding filters, and adding transitions.
[0003] However, the video processing methods provided by current video processing software are often relatively simple, and the video processing effects cannot meet the actual needs of users. Summary of the invention
[0004] The embodiments of the present disclosure provide a video processing method, apparatus, device, computer-readable storage medium, and product, which are used to solve the technical problem that the existing video processing methods have relatively single effects.
[0005] In a first aspect, an embodiment of the present disclosure provides a video processing method, including:
[0006] Obtain the video to be processed and obtain the target noise map;
[0007] Determine normal information corresponding to pixels in the target noise map;
[0008] Adjusting pixel distribution of a video frame in the to-be-processed video based on the normal information to obtain an adjusted video;
[0009] The video frames in the adjusted video are blurred to obtain a target video.
[0010] In a second aspect, an embodiment of the present disclosure provides a video processing device, including:
[0011] An acquisition module is used to acquire the video to be processed and to acquire a target noise map;
[0012] A determination module, used to determine normal information corresponding to pixels in the target noise map;
[0013] An adjustment module, configured to adjust pixel distribution of a video frame in the video to be processed based on the normal information to obtain an adjusted video;
[0014] The processing module is used to perform blur processing on the video frames in the adjusted video to obtain a target video.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0016] The memory stores computer-executable instructions;
[0017] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect and various possible designs of the first aspect.
[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0019] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method as described in the first aspect and various possible designs of the first aspect.
[0020] The video processing method, device, equipment, computer-readable storage medium and product provided in this embodiment adjust the pixel distribution of the video frame in the processed video based on the normal information of the target noise map after obtaining the video to be processed and the target noise map, so that the adjusted video can simulate a refraction effect similar to glass. Furthermore, the video frames in the adjusted video can be blurred, so that the target video can simulate the effect of superimposing a layer of material on the video content, wherein the material can be set by the user according to actual needs, for example, the material can be glass, frosted glass, etc. Therefore, the target video can be processed in a more diverse manner, the processing effect of the target video can be improved, and the processing of the target video can be more in line with the personalized needs of the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 A schematic diagram of a video processing method according to an embodiment of the present disclosure;
[0023] Figure 2 A schematic diagram of a video processing method according to another embodiment of the present disclosure;
[0024] Figure 3 An exemplary target noise map provided for an embodiment of the present disclosure;
[0025] Figure 4 A schematic diagram of a video processing method according to another embodiment of the present disclosure;
[0026] Figure 5 A schematic diagram of a video processing method according to another embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram of a video processing method according to another embodiment of the present disclosure;
[0028] Figure 7 A schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure;
[0029] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0031] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0032] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0033] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0034] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0035] In order to solve the technical problem that existing video processing methods have poor effects, the present disclosure provides a video processing method, device, equipment, computer-readable storage medium and product.
[0036] It should be noted that the video processing method, apparatus, device, computer-readable storage medium and product provided by the present disclosure can be applied in any video processing application scenario.
[0037] Current video processing methods generally include editing the video, adding filters, adding transitions, etc. However, when using the above methods for video processing, generally only the color tone, duration and other attributes of the video can be adjusted, and the video processing effect often cannot meet the actual needs of users.
[0038] In the process of solving the above technical problems, the inventors discovered through research that in order to improve the video processing effect, the effect of shooting a video through materials such as glass can be simulated.
[0039] Optionally, the video to be processed and the target noise map can be obtained, wherein the target noise map can be determined by the user according to actual needs. The pixel distribution of the video frame in the video to be processed is adjusted based on the normal information of the target noise map, so that the adjusted video can simulate a refraction effect similar to glass. The pixel distribution of the video to be processed is adjusted based on different noise maps to simulate different glass textures. Furthermore, the video frames in the adjusted video can be blurred, so that the target video can simulate the display effect of adding a layer of frosted glass on the video content.
[0040] Figure 1 A schematic diagram of a video processing method provided by an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method includes:
[0041] Step 101: Obtain a video to be processed and obtain a target noise map.
[0042] The execution subject of this embodiment is a video processing device, which can be coupled to a server. The server can be connected to the terminal device and the data server in communication. Therefore, based on the video processing request sent by the terminal device, the video to be processed and the target noise map can be obtained from the data server, and the video to be processed can be processed based on the target noise map to present the effect of glass refraction on the video to be processed.
[0043] Alternatively, the video processing device can be coupled to a terminal device, so that it can obtain the video to be processed and the target noise map in response to a video processing request triggered by a user, and perform video processing on the video to be processed based on the target noise map to present the effect of glass refraction on the video to be processed.
[0044] In this embodiment, in order to implement the video processing operation, the video to be processed and the target noise map can be first obtained, so that the video to be processed can be processed based on the target noise map to present the effect of glass refraction on the video to be processed. The video to be processed can be uploaded by the user according to actual needs, or can be collected in real time, and the present disclosure does not limit this.
[0045] Optionally, the target noise map may be formed by combining a plurality of preset noises with different distributions using a fractal Brownian motion function.
[0046] Step 102: Determine normal information corresponding to pixels in the target noise map.
[0047] In this embodiment, after obtaining the target noise map, the video frame can be controlled to simulate the offset and distortion in the target noise map to present the effect of glass refraction. In order to adjust the pixel distribution of the video frame, it is first necessary to determine the normal information corresponding to each pixel in the target noise map.
[0048] Step 103: Adjust the pixel distribution of the video frame in the to-be-processed video based on the normal information to obtain an adjusted video.
[0049] In this embodiment, after obtaining the normal information corresponding to the pixels in the target noise map, the pixel distribution of the video frame in the video to be processed can be adjusted based on the normal information so that the video frame simulates the offset and distortion in the target noise map, presents the effect of glass refraction, and obtains the adjusted video.
[0050] Step 104: blur the video frames in the adjusted video to obtain a target video.
[0051] In this embodiment, in order to further improve the authenticity of the glass texture, the adjusted video may be controlled to simulate the frosted texture of the glass.
[0052] Optionally, the video frames in the adjusted video may be blurred to obtain a target video.
[0053] Optionally, based on any of the above embodiments, step 104 includes:
[0054] Gaussian blur processing is performed on the video frames in the adjusted video to obtain the target video.
[0055] In this embodiment, the video frames in the adjusted video may be subjected to Gaussian blur processing to obtain the target video, so that the target video can present the frosted texture of glass.
[0056] Optionally, any blur algorithm may be used to implement blur processing on the video frames in the adjusted video, and the present disclosure does not impose any limitation on this.
[0057] The video processing method provided in this embodiment adjusts the pixel distribution of the video frame in the video to be processed based on the normal information of the target noise map after obtaining the video to be processed and the target noise map, so that the adjusted video can simulate a refraction effect similar to glass. Furthermore, the video frames in the adjusted video can be blurred, so that the target video can simulate the display effect of adding a layer of frosted glass on the video content, further improving the video processing effect of the target video.
[0058] Figure 2 A flowchart of a video processing method provided by another embodiment of the present disclosure is provided. Based on any of the above embodiments, Figure 2 As shown, step 101 includes:
[0059] Step 201: Obtain a video processing request, wherein the video processing request includes a video processing effect.
[0060] Step 202: Based on the video content uploaded or collected by the video processing request, determine the video content as the video to be processed.
[0061] Step 203: Acquire a noise map matching the video processing effect from a preset noise map set, and determine the noise map matching the video processing effect as the target noise map.
[0062] In this embodiment, in order to implement the video processing operation, a video processing request may be obtained. The video processing request may be triggered by a user on a terminal device based on actual needs. When the user triggers the video processing request, a corresponding video processing effect may be selected so that the processed target video presents different glass refraction textures.
[0063] Further, after obtaining the video processing request, the video to be processed can be obtained. The video to be processed can be uploaded by the user according to actual needs, or can also be collected by the user in real time, and the present disclosure does not limit this.
[0064] It should be noted that users can also upload or collect images to adjust the image texture.
[0065] Furthermore, after the video processing effect is determined, a noise map matching the video processing effect may be obtained from a preset noise map set, and the noise map matching the video processing effect may be determined as a target noise map.
[0066] Figure 3 An exemplary target noise map provided for an embodiment of the present disclosure is as follows: Figure 3 As shown, the target noise map 31 can be formed by combining a plurality of preset noises with different distributions using a fractal Brownian motion function.
[0067] In practical applications, a variety of different noise maps can be pre-set, wherein the pixel distribution adjustment operation is performed on the video frames in the processed video based on different noise maps, so as to achieve the refraction effect of different glass textures. Among them, the glass texture includes but is not limited to different frosting degrees, different grid sizes, etc. When the user is processing the video, the video processing effect can be selected, wherein the video processing effect includes but is not limited to the grid glass processing effect, the frosted glass processing effect, etc. Based on the video processing effect, a matching noise map is selected for subsequent video processing.
[0068] The video processing method provided in this embodiment can make the video processing effect more in line with the user's personalized needs and improve the user experience by respectively obtaining the video to be processed determined by the user and obtaining the noise map matching the video processing effect.
[0069] Further, based on any of the above embodiments, step 102 includes:
[0070] The target noise image is adjusted to a grayscale image.
[0071] Derivatives are performed on adjacent pixels in the first coordinate axis and the second coordinate axis for the pixels in the grayscale image, and the third coordinate axis direction of the pixels in the grayscale image is fixed to a preset direction to obtain the normal information.
[0072] In this embodiment, after the target noise map is acquired, the video frame may be controlled to simulate the offset and distortion degree in the target noise map to present the effect of glass refraction.
[0073] In order to adjust the pixel distribution of the video frame, it is first necessary to determine the normal information of the target noise map.
[0074] Optionally, the target noise image may be adjusted to a grayscale image. The pixels in the grayscale image are derivatized with respect to adjacent pixels in the first coordinate axis and the second coordinate axis, and the third coordinate axis direction of the pixels in the grayscale image is fixed to a preset direction to obtain normal information.
[0075] The first coordinate axis may be a lower X axis, the second coordinate axis may be a Y axis, and the third coordinate axis may be a Z axis. The preset direction may be a vertical outward direction.
[0076] The video processing method provided in this embodiment converts the target noise image into a grayscale image, and then derives the pixel values of the grayscale image in the x-axis and y-axis directions of adjacent pixels to obtain a gradient image to simulate the xy-axis direction of its normal, wherein the z-axis direction is fixed to be vertically outward, thereby being able to accurately determine the normal information of each pixel point.
[0077] Figure 4 A flowchart of a video processing method provided by another embodiment of the present disclosure is provided. Based on any of the above embodiments, Figure 4 As shown, step 103 includes:
[0078] Step 401: Determine a target offset based on the normal information and a preset offset algorithm.
[0079] Step 402: Perform an offset process on pixels in a video frame corresponding to the video to be processed according to a target offset to obtain an adjusted video.
[0080] In this embodiment, after determining the normal information corresponding to the target noise map, the target offset can be determined based on the normal information corresponding to the target noise map, and the pixel distribution in the video frame can be adjusted based on the target offset so that the video frame can simulate the offset and distortion in the target noise map to present the effect of glass refraction.
[0081] Optionally, the target offset can be determined based on the normal information and a preset offset algorithm. The difference between the normal information and the preset parameter can be multiplied by the offset degree parameter to obtain the result to be processed. Since the value of the normal information is (-1, 1), after the normal information is subtracted from the preset parameter, the value range of the result to be processed may be different from the value range of the normal information. Therefore, the value range of the result to be processed can also be readjusted to (-1, 1) to obtain the target offset.
[0082] It should be noted that the user can adjust the offset degree parameter according to actual needs, and by adjusting the offset degree parameter, the target offset can be adjusted. The larger the target offset, the more obvious the glass refraction effect.
[0083] Furthermore, pixels in a video frame corresponding to the video to be processed may be offset according to the target offset to obtain an adjusted video.
[0084] Optionally, the pixel coordinates in the video frame may be added to a preset parameter and divided by 2 to obtain a preprocessing result, and the preprocessing result may be multiplied by a target offset to implement offset processing of pixels in a video frame corresponding to the video to be processed, thereby obtaining an adjusted video.
[0085] The video processing method provided in this embodiment determines the target offset based on normal information, and performs offset processing on the pixels in the video frame corresponding to the video to be processed based on the target offset, so that the adjusted video can simulate a refraction effect similar to glass, and adjust the material of the video to be processed to improve the video processing effect.
[0086] Further, based on any of the above embodiments, the offset algorithm includes an offset degree parameter. The method further includes:
[0087] In response to an adjustment operation triggered by a user, a target offset degree parameter determined by the user is acquired.
[0088] The offset degree parameter in the offset algorithm is adjusted according to the target offset degree parameter to obtain an adjusted offset algorithm.
[0089] Step 401 includes:
[0090] A target offset is determined based on the normal information and the adjusted offset algorithm.
[0091] In this embodiment, the offset algorithm includes an offset degree parameter. By adjusting the offset degree parameter, the target offset can be adjusted, and then the glass refraction effect can be adjusted based on the adjustment of the target offset. The larger the target offset, the more obvious the glass refraction effect.
[0092] Optionally, as shown in Formula 1, 0.12 in Formula 1 is the offset degree parameter.
[0093] In order to make the video processing effect more in line with the personalized needs of the user, the user can adjust the offset degree parameter. In response to the adjustment operation triggered by the user, the target offset degree parameter determined by the user is obtained. The offset degree parameter in the offset algorithm is adjusted according to the target offset degree parameter to obtain the adjusted offset algorithm. Therefore, the target offset can be determined based on the normal information and the adjusted offset algorithm.
[0094] For example, the user can adjust the offset parameter from 0.12 to 0.3 according to actual needs, thereby increasing the glass refraction effect.
[0095] The video processing method provided in this embodiment adjusts the offset degree parameter in the offset algorithm through an adjustment operation triggered by the user, so that the video processing effect can be more in line with the personalized needs of the user and the user experience can be improved.
[0096] Figure 5 A flowchart of a video processing method provided by another embodiment of the present disclosure is provided. Based on any of the above embodiments, Figure 5 As shown, after step 102, the following steps are also included:
[0097] Step 501: Determine the timing information corresponding to the video frames in the video to be processed.
[0098] Step 502: adjusting the normal information according to the timing information and a preset normal adjustment algorithm, so that the normal information is gradually adjusted to a preset normal according to the timing information.
[0099] In this embodiment, in order to enrich the display effect of the target video, after adjusting the pixel distribution of the video frame based on the normal information of the target noise map and simulating the glass refraction effect, the glass texture can also be gradually adjusted.
[0100] Optionally, the effect of the glass texture gradually disappearing may be simulated, or the effect of the glass texture gradually weakening may be simulated.
[0101] In order to achieve a gradual adjustment effect of glass texture, for a video frame in a to-be-processed video, the timing information corresponding to the video frame may be determined, wherein the timing information may be a timestamp of the video frame in the to-be-processed video.
[0102] Furthermore, the normal information can be adjusted based on the timing information and the preset normal adjustment algorithm, so that the normal information is gradually adjusted to the preset normal according to the timing information. The normal information can be (x, y, z), and the preset normal can be (0, 0, 1). By adjusting the normal information from (x, y, z) to (0, 0, 1), the effect of the glass texture gradually disappearing can be simulated. Alternatively, the preset normal can be a value set by the user according to actual needs to present different gradient effects, and the present disclosure does not limit this.
[0103] Optionally, the normal adjustment algorithm may be (1-t)*vec3(x, y, z)+t*vec3(0, 0, 1), through which the normal adjustment algorithm may linearly adjust the normal information from (x, y, z) to (0, 0, 1) to achieve a gradient effect. Alternatively, the gradient adjustment of the glass texture may be achieved by other gradient algorithms, which is not limited in the present disclosure.
[0104] The video processing method provided in this embodiment adjusts the normal information according to the timing information and the preset normal adjustment algorithm, and gradually adjusts the normal information to the preset normal according to the timing information, thereby simulating the effect of the glass texture gradually disappearing, enriching the display effect of the video processing, and improving the quality of the target video.
[0105] Further, based on any of the above embodiments, step 103 includes:
[0106] For each video frame in the video to be processed, target normal information corresponding to the video frame is determined according to timing information corresponding to the video frame.
[0107] The pixel distribution of the video frame in the to-be-processed video is adjusted based on the target normal information to obtain an adjusted video frame.
[0108] The target video is obtained according to the adjusted video frame.
[0109] In this embodiment, in order to enable the target video to present a glass texture gradient effect, for each video frame, the timing information corresponding to the video frame can be determined. The target normal information corresponding to the video frame is determined based on the timing information. Since the timing information corresponding to each video frame is different, the target normal information corresponding to different video frames is also different. As the timing information gradually increases, the glass texture gradient effect can be presented in different video frames.
[0110] Optionally, after determining the target normal information corresponding to the video frame, the pixel distribution of the video frame in the to-be-processed video can be adjusted based on the target normal information to obtain an adjusted video frame. Since the timing information corresponding to each video frame is different, the video frames adjusted based on the target normal information corresponding to different video frames can also present different glass refraction effects.
[0111] Furthermore, after the video frames are adjusted based on the target normal information corresponding to each video frame, the target video may be constructed based on the adjusted multiple video frames.
[0112] The video processing method provided in this embodiment determines the corresponding target normal information for each video frame, so as to present different glass refraction effects in each video frame and accurately simulate the effect of the glass texture gradually disappearing.
[0113] Figure 6 A flowchart of a video processing method provided by another embodiment of the present disclosure is provided. Based on any of the above embodiments, Figure 6 As shown, after step 104, the following steps are also included:
[0114] Step 601: Obtain preset color distribution information.
[0115] Step 602: Overlay the color distribution information on the video frame in the target video.
[0116] In this embodiment, in order to further enrich the display effect of the target video, other colors may be superimposed in the video frame of the target video to present a display effect of colors passing through glass.
[0117] Optionally, preset color distribution information may be obtained, wherein the color distribution information may be selected by the user according to actual needs, or the color distribution information may be generated based on the video frame content, which is not limited in the present disclosure.
[0118] Further, after the color distribution information is determined, the color distribution information may be superimposed on the video frames in the target video.
[0119] The video processing method provided in this embodiment can further improve the quality of the target video by superimposing the color distribution information on the video frames in the adjusted target video.
[0120] Further, based on any of the above embodiments, after step 601, the method further includes:
[0121] For video frames in the video to be processed, timing information corresponding to the video frames is determined.
[0122] The color distribution information is adjusted according to the timing information and a preset color adjustment algorithm, so that the color distribution information is gradually adjusted to a preset color distribution.
[0123] In this embodiment, in order to enrich the display effect of the target video, after the color distribution information is superimposed on the target video, the display effect of the gradual change of the color distribution information can also be simulated.
[0124] Optionally, for a video frame in a video to be processed, timing information corresponding to the video frame is determined. The color distribution information is adjusted according to the timing information and a preset color adjustment algorithm, so that the color distribution information is gradually adjusted to a preset color distribution. The preset color distribution may be a color distribution set by a user according to actual needs, or may simulate a display effect in which the color of the color distribution information gradually fades from rich to disappearing.
[0125] The video processing method provided in this embodiment adjusts the color distribution information according to the timing information and a preset color adjustment algorithm, and gradually adjusts the color distribution information to a preset color distribution according to the timing information, thereby simulating the effect of the color distribution gradually disappearing, enriching the display effect of the video processing, and improving the quality of the target video.
[0126] Further, based on any of the above embodiments, step 602 includes:
[0127] For each video frame in the to-be-processed video, a target color distribution corresponding to the video frame is determined according to timing information corresponding to the video frame.
[0128] The target color distribution is superimposed on the video frames in the adjusted target video.
[0129] In this embodiment, in order to accurately perform the gradual change processing of color distribution, for each video frame in the video to be processed, the target color distribution corresponding to the video frame is determined according to the timing information corresponding to the video frame. Since the timing information corresponding to each video frame is different, the target color distribution corresponding to different video frames is also different. As the timing information gradually increases, the effect of gradual change of color distribution can be presented in different video frames.
[0130] Further, after determining the target color distribution corresponding to the video frame, the target color distribution may be superimposed on the video frame. The superimposition operation of the target color distribution may be implemented in any superimposition manner, and the present disclosure does not limit this.
[0131] The video processing method provided in this embodiment determines the corresponding target color distribution for each video frame, so as to present different color superposition effects in each video frame and accurately simulate the effect of the color distribution gradually disappearing.
[0132] Figure 7 A schematic diagram of the structure of a video processing device provided in an embodiment of the present disclosure is shown in FIG. Figure 7 As shown, the device includes: an acquisition module 71, a determination module 72, an adjustment module 73 and a processing module 74. The acquisition module 71 is used to acquire the video to be processed and the target noise map. The determination module 72 is used to determine the normal information corresponding to the pixels in the target noise map. The adjustment module 73 is used to adjust the pixel distribution of the video frame in the video to be processed based on the normal information to obtain the adjusted video. The processing module 74 is used to blur the video frame in the adjusted video to obtain the target video.
[0133] Further, based on any of the above embodiments, the acquisition module is used to: acquire a video processing request, wherein the video processing request includes a video processing effect. Based on the video content uploaded or collected by the video processing request, the video content is determined as the video to be processed. A noise map matching the video processing effect is acquired from a preset noise map set, and the noise map matching the video processing effect is determined as the target noise map.
[0134] Further, based on any of the above embodiments, the determination module is used to: adjust the target noise image to a grayscale image, perform derivatives of adjacent pixels in the first coordinate axis and the second coordinate axis for pixels in the grayscale image, fix the third coordinate axis direction of the pixels in the grayscale image to a preset direction, and obtain the normal information.
[0135] Further, based on any of the above embodiments, the adjustment module is used to: determine a target offset based on the normal information and a preset offset algorithm, and perform offset processing on pixels in a video frame corresponding to the video to be processed according to the target offset to obtain an adjusted video.
[0136] Further, based on any of the above embodiments, the offset algorithm includes an offset degree parameter. The device further includes: an acquisition module, which is used to obtain the target offset degree parameter determined by the user in response to an adjustment operation triggered by the user. An adjustment module, which is used to adjust the offset degree parameter in the offset algorithm according to the target offset degree parameter to obtain an adjusted offset algorithm. The adjustment module is also used to determine the target offset based on the normal information and the adjusted offset algorithm.
[0137] Further, based on any of the above embodiments, the processing module is used to: perform Gaussian blur processing on the video frames in the adjusted video to obtain the target video.
[0138] Further, based on any of the above embodiments, the device further includes: a determination module, for determining the timing information corresponding to the video frame in the video to be processed; an adjustment module, for adjusting the normal information according to the timing information and a preset normal adjustment algorithm, so that the normal information is gradually adjusted to a preset normal according to the timing information.
[0139] Further, based on any of the above embodiments, the adjustment module is used to: for each video frame in the video to be processed, determine the target normal information corresponding to the video frame according to the timing information corresponding to the video frame. Adjust the pixel distribution of the video frame in the video to be processed based on the target normal information to obtain an adjusted video frame. Obtain the target video according to the adjusted video frame.
[0140] Further, based on any of the above embodiments, the device further comprises: an acquisition module, configured to acquire preset color distribution information; and a processing module, configured to superimpose the color distribution information on a video frame in the target video.
[0141] Further, based on any of the above embodiments, the device further includes: a determination module, for determining the timing information corresponding to the video frame in the video to be processed; an adjustment module, for adjusting the color distribution information according to the timing information and a preset color adjustment algorithm, so that the color distribution information is gradually adjusted to a preset color distribution.
[0142] Further, based on any of the above embodiments, the processing module is used to: for each video frame in the to-be-processed video, determine the target color distribution corresponding to the video frame according to the timing information corresponding to the video frame, and superimpose the target color distribution on the video frame in the adjusted target video.
[0143] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0144] In order to implement the above embodiment, the present disclosure also provides an electronic device, including: a processor and a memory;
[0145] The memory stores computer-executable instructions;
[0146] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the video processing method as described in any of the above embodiments.
[0147] In order to implement the above embodiments, the embodiments of the present disclosure further provide a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video processing method described in any of the above embodiments is implemented.
[0148] In order to implement the above embodiments, the embodiments of the present disclosure further provide a computer program product, including a computer program, and when the computer program is executed by a processor, the video processing method as described in any of the above embodiments is implemented.
[0149] Figure 8The electronic device 800 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, and the electronic device 800 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (Portable Media Players, PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0150] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 to a random access memory (RAM) 803. Various programs and data required for the operation of the electronic device 800 are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0151] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0152] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0153] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0154] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0155] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0156] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0157] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0158] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0159] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0160] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0161] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0162] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0163] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A video processing method, characterized in that: include: Obtain the video to be processed and obtain the target noise map; Determine normal information corresponding to pixels in the target noise map; Adjusting pixel distribution of a video frame in the to-be-processed video based on the normal information to obtain an adjusted video; The video frames in the adjusted video are blurred to obtain a target video.
2. The method according to claim 1, characterized in that The step of obtaining the video to be processed and obtaining the target noise map includes: Obtaining a video processing request, wherein the video processing request includes a video processing effect; Based on the video content uploaded or collected by the video processing request, determining the video content as the video to be processed; A noise map matching the video processing effect is obtained from a preset noise map set, and the noise map matching the video processing effect is determined as the target noise map.
3. The method according to claim 1, characterized in that Determining normal information corresponding to pixels in the target noise map includes: Adjusting the target noise image to a grayscale image; Derivatives are performed on adjacent pixels in the first coordinate axis and the second coordinate axis for the pixels in the grayscale image, and the third coordinate axis direction of the pixels in the grayscale image is fixed to a preset direction to obtain the normal information.
4. The method according to claim 1, characterized in that: The step of adjusting the pixel distribution of the video frame in the to-be-processed video based on the normal information to obtain the adjusted video includes: Determining a target offset based on the normal information and a preset offset algorithm; The pixels in the video frame corresponding to the video to be processed are offset according to the target offset to obtain an adjusted video.
5. The method according to claim 4, characterized in that The offset algorithm includes an offset degree parameter; the method further includes: In response to an adjustment operation triggered by a user, obtaining a target offset degree parameter determined by the user; Adjusting the offset degree parameter in the offset algorithm according to the target offset degree parameter to obtain an adjusted offset algorithm; The determining of the target offset based on the normal information and a preset offset algorithm includes: A target offset is determined based on the normal information and the adjusted offset algorithm.
6. The method according to claim 1, characterized in that The blurring of the video frames in the adjusted video to obtain the target video includes: Gaussian blur processing is performed on the video frames in the adjusted video to obtain the target video.
7. The method according to any one of claims 1 to 6, characterized in that: After determining the normal information corresponding to the pixel in the target noise map, the method further includes: For a video frame in a video to be processed, determining timing information corresponding to the video frame; The normal information is adjusted according to the timing information and a preset normal adjustment algorithm, so that the normal information is gradually adjusted to a preset normal according to the timing information.
8. The method according to claim 7, characterized in that The step of adjusting the pixel distribution of the video frame in the to-be-processed video based on the normal information to obtain the adjusted video includes: For a video frame in the video to be processed, determining target normal information corresponding to the video frame according to timing information corresponding to the video frame; Adjusting pixel distribution of a video frame in the to-be-processed video based on the target normal information to obtain an adjusted video frame; The target video is obtained according to the adjusted video frame.
9. The method according to any one of claims 1 to 6, characterized in that: After blurring the video frames in the adjusted video to obtain the target video, the method further includes: Get preset color distribution information; The color distribution information is superimposed on a video frame in the target video.
10. The method according to claim 9, characterized in that After obtaining the preset color distribution information, the method further includes: For video frames in the video to be processed, determining timing information corresponding to the video frames; The color distribution information is adjusted according to the timing information and a preset color adjustment algorithm, so that the color distribution information is gradually adjusted to a preset color distribution.
11. The method according to claim 10, characterized in that The step of superimposing the color distribution information on the video frame in the target video includes: For a video frame in the video to be processed, determining a target color distribution corresponding to the video frame according to timing information corresponding to the video frame; The target color distribution is superimposed on the video frames in the adjusted target video.
12. A video processing device, characterized in that: include: An acquisition module is used to acquire the video to be processed and to acquire a target noise map; A determination module, used to determine normal information corresponding to pixels in the target noise map; An adjustment module, configured to adjust pixel distribution of a video frame in the video to be processed based on the normal information to obtain an adjusted video; The processing module is used to perform blur processing on the video frames in the adjusted video to obtain a target video.
13. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the video processing method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the video processing method according to any one of claims 1 to 11 is implemented.