技术领域Technical field
本发明涉及视频处理领域,更具体的说,涉及一种视频帧处理方法、装置及电子设备。The present invention relates to the field of video processing, and more specifically, to a video frame processing method, device and electronic equipment.
背景技术Background technique
随着短视频行业的快速发展,用户对美颜的需求不再仅仅局限于照片,越来越多的需求体现在视频中。现在很多视频类的平台或者视频剪辑都需要用到滤镜效果。如果接入滤镜效果,会提升视频色调风格,将镜头里的内容变得更有格调和满足用户视觉效果需求。With the rapid development of the short video industry, users' demand for beauty is no longer limited to photos, but more and more demands are reflected in videos. Nowadays, many video platforms or video editing require the use of filter effects. If you add a filter effect, it will improve the tone and style of the video, make the content in the shot more stylish and meet the user's visual needs.
目前,在对视频进行滤镜效果添加时,是以视频帧为单位进行滤镜添加,在添加滤镜时,对整张视频帧进行统一处理,即对整张视频帧添加同样的滤镜效果。Currently, when adding filter effects to videos, filters are added in units of video frames. When adding filters, the entire video frame is processed uniformly, that is, the same filter effect is added to the entire video frame. .
这种滤镜添加方式,只能添加一种滤镜效果,滤镜效果单一,进而使得视频特效较差,降低视频合成质量,无法满足用户的滤镜需求。This filter adding method can only add one filter effect, and the filter effect is single, which makes the video special effects poor, reduces the video synthesis quality, and cannot meet the user's filter needs.
发明内容Contents of the invention
有鉴于此,本发明提供一种视频帧处理方法、装置及电子设备,以解决在对视频帧添加滤镜效果时,是对整张视频帧进行统一处理,滤镜效果单一,视频特效较差,降低视频合成质量,无法满足用户的滤镜需求的问题。In view of this, the present invention provides a video frame processing method, device and electronic equipment to solve the problem that when adding filter effects to video frames, the entire video frame is processed uniformly, the filter effect is single, and the video special effects are poor. , reducing the quality of video synthesis and failing to meet the user’s filter needs.
为解决上述技术问题,本发明采用了如下技术方案:In order to solve the above technical problems, the present invention adopts the following technical solutions:
一种视频帧处理方法,包括:A video frame processing method, including:
获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧;Obtain video frames in the target video that require filter addition operations, and convert the video frames into target video frames in a preset format;
对所述目标视频帧进行分块,得到多个子视频帧;Divide the target video frame into blocks to obtain multiple sub-video frames;
按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。According to the arrangement order of the plurality of sub-video frames, the gray value of the edge of the sub-video frame is dynamically set to the corresponding target gray value, and the transparency of the edge of the sub-video frame is set to the corresponding target transparency.
可选地,在将所述视频帧转化为预设格式的目标视频帧之后,还包括:Optionally, after converting the video frames into target video frames in a preset format, the method further includes:
提取所述目标视频帧中的像素的预设通道的通道值,并对所述通道值进行修正操作,得到修正后的通道值;Extract the channel value of the preset channel of the pixel in the target video frame, and perform a correction operation on the channel value to obtain a corrected channel value;
根据修正后的通道值,计算所述像素的线性校正值;Calculate the linear correction value of the pixel according to the corrected channel value;
确定所述线性校正值对应的灰度值,并作为所述像素的灰度值。The grayscale value corresponding to the linear correction value is determined and used as the grayscale value of the pixel.
可选地,在确定所述线性校正值对应的灰度值,并作为所述像素的灰度值之后,对所述目标视频帧进行分块,得到多个子视频帧之前,还包括:Optionally, after determining the grayscale value corresponding to the linear correction value and using it as the grayscale value of the pixel, dividing the target video frame into blocks to obtain multiple sub-video frames, the method further includes:
对所述目标视频帧进行滤波操作。Perform a filtering operation on the target video frame.
可选地,对所述目标视频帧进行分块,得到多个子视频帧,包括:Optionally, the target video frame is divided into blocks to obtain multiple sub-video frames, including:
将所述目标视频帧拆分为边长为预设长度的多个矩形图片,并将每一矩形图片作为一子视频帧;Split the target video frame into multiple rectangular pictures with side lengths of a preset length, and treat each rectangular picture as a sub-video frame;
基于所述预设长度,设置所述子视频帧边长的像素值。Based on the preset length, the pixel value of the side length of the sub-video frame is set.
可选地,按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度,包括:Optionally, according to the arrangement order of the plurality of sub-video frames, the gray value of the edge of the sub-video frame is dynamically set to the corresponding target gray value, and the transparency of the edge of the sub-video frame is set to the corresponding target. Transparency, including:
确定所述子视频帧的边缘的目标灰度值以及目标透明度;Determine the target gray value and target transparency of the edge of the sub-video frame;
按照所述多个子视频帧的排列顺序,在不同的滤镜添加时间内,将所述滤镜添加时间对应的所述子视频帧的边缘的灰度值设置为所述目标灰度值,以及将所述子视频帧的边缘的透明度设置为所述目标透明度。According to the arrangement order of the plurality of sub-video frames, during different filter addition times, the gray value of the edge of the sub-video frame corresponding to the filter addition time is set to the target gray value, and The transparency of the edge of the sub-video frame is set to the target transparency.
可选地,确定所述子视频帧的边缘的目标灰度值以及目标透明度,包括:Optionally, determining the target gray value and target transparency of the edge of the sub-video frame includes:
对所述子视频帧进行边缘检测处理,以确定所述子视频帧的边缘;Perform edge detection processing on the sub-video frame to determine the edge of the sub-video frame;
获取在所述边缘的预设范围内的像素的灰度值;Obtain the grayscale value of the pixel within the preset range of the edge;
基于在所述边缘的预设范围内的像素的灰度值,对所述边缘的灰度值进行修正,得到所述子视频帧的边缘的目标灰度值;Based on the grayscale value of the pixel within the preset range of the edge, correct the grayscale value of the edge to obtain the target grayscale value of the edge of the sub-video frame;
获取所述子视频帧的边缘的透明度,以及所述透明度所在的透明度区间的透明度系数;Obtain the transparency of the edge of the sub-video frame and the transparency coefficient of the transparency interval where the transparency is located;
根据预设最大透明度值、所述子视频帧的边缘的透明度以及所述透明度系数,计算所述子视频帧的边缘的目标透明度。The target transparency of the edge of the sub-video frame is calculated according to the preset maximum transparency value, the transparency of the edge of the sub-video frame and the transparency coefficient.
可选地,按照所述多个子视频帧的排列顺序,在不同的滤镜添加时间内,将所述滤镜添加时间对应的所述子视频帧的边缘的灰度值设置为所述目标灰度值,以及将所述子视频帧的边缘的透明度设置为所述目标透明度,包括:Optionally, according to the arrangement order of the plurality of sub-video frames, during different filter addition times, the gray value of the edge of the sub-video frame corresponding to the filter addition time is set to the target gray value. degree value, and setting the transparency of the edge of the sub-video frame to the target transparency, including:
获取所述目标视频帧的滤镜添加总时间,并根据所述滤镜添加总时间以及所述子视频帧的数量,计算所述子视频帧的滤镜添加时间;Obtain the total filter adding time of the target video frame, and calculate the filter adding time of the sub-video frame according to the total filter adding time and the number of the sub-video frames;
按照所述多个子视频帧的排列顺序,确定每一滤镜添加时间对应的子视频帧;Determine the sub-video frame corresponding to each filter addition time according to the arrangement order of the plurality of sub-video frames;
在不同的滤镜添加时间内,设置所述滤镜添加时间对应的所述子视频帧的边缘的灰度值为所述目标灰度值,以及设置所述子视频帧的边缘的透明度为所述目标透明度。During different filter adding times, the grayscale value of the edge of the sub-video frame corresponding to the filter adding time is set to the target grayscale value, and the transparency of the edge of the sub-video frame is set to the target grayscale value. transparency of stated goals.
一种视频帧处理装置,包括:A video frame processing device, including:
视频帧转化模块,用于获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧;A video frame conversion module, used to obtain video frames in the target video that require filter addition operations, and convert the video frames into target video frames in a preset format;
视频帧处理模块,用于对所述目标视频帧进行分块,得到多个子视频帧;A video frame processing module, used to divide the target video frame into blocks to obtain multiple sub-video frames;
滤镜处理模块,用于按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。A filter processing module, configured to dynamically set the grayscale value of the edge of the sub-video frame to the corresponding target grayscale value according to the arrangement order of the multiple sub-video frames, and the transparency of the edge of the sub-video frame is The corresponding target transparency.
可选地,还包括:Optionally, also includes:
通道值处理模块,用于提取所述目标视频帧中的像素的预设通道的通道值,并对所述通道值进行修正操作,得到修正后的通道值;The channel value processing module is used to extract the channel value of the preset channel of the pixel in the target video frame, and perform a correction operation on the channel value to obtain the corrected channel value;
校正模块,用于根据修正后的通道值,计算所述像素的线性校正值;A correction module, used to calculate the linear correction value of the pixel based on the corrected channel value;
灰度值确定模块,用于确定所述线性校正值对应的灰度值,并作为所述像素的灰度值。A grayscale value determination module is used to determine the grayscale value corresponding to the linear correction value and use it as the grayscale value of the pixel.
可选地,还包括:Optionally, also includes:
滤镜模块,用于对所述目标视频帧进行滤波操作。A filter module is used to perform a filtering operation on the target video frame.
可选地,所述视频帧处理模块具体用于:Optionally, the video frame processing module is specifically used to:
将所述目标视频帧拆分为边长为预设长度的多个矩形图片,并将每一矩形图片作为一子视频帧,基于所述预设长度,设置所述子视频帧边长的像素值。Split the target video frame into multiple rectangular pictures with a side length of a preset length, and treat each rectangular picture as a sub-video frame. Based on the preset length, set the pixels of the side length of the sub-video frame. value.
可选地,所述滤镜处理模块包括:Optionally, the filter processing module includes:
数据确定子模块,用于确定所述子视频帧的边缘的目标灰度值以及目标透明度;Data determination submodule, used to determine the target gray value and target transparency of the edge of the sub-video frame;
滤镜添加子模块,用于按照所述多个子视频帧的排列顺序,在不同的滤镜添加时间内,将所述滤镜添加时间对应的所述子视频帧的边缘的灰度值设置为所述目标灰度值,以及将所述子视频帧的边缘的透明度设置为所述目标透明度。The filter adding sub-module is used to set the grayscale value of the edge of the sub-video frame corresponding to the filter adding time at different filter adding times according to the arrangement order of the multiple sub-video frames. The target grayscale value, and the transparency of the edge of the sub-video frame is set to the target transparency.
一种电子设备,包括:存储器和处理器;An electronic device including: memory and processor;
其中,所述存储器用于存储程序;Wherein, the memory is used to store programs;
处理器调用程序并用于执行上述的视频帧处理方法。The processor calls the program and is used to execute the above video frame processing method.
相较于现有技术,本发明具有以下有益效果:Compared with the existing technology, the present invention has the following beneficial effects:
本发明提供了一种视频帧处理方法、装置及电子设备,获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧,对所述目标视频帧进行分块,得到多个子视频帧,按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。即本发明中,对一个视频帧拆分得到的子视频帧动态添加滤镜,增加滤镜效果,进而提高视频特效,提高视频合成质量,满足用户的滤镜需求。另外,本发明中,将所述视频帧转化为预设格式的目标视频帧,能够保证在添加滤镜效果时,实现无损滤镜处理效果。The present invention provides a video frame processing method, device and electronic equipment, which acquires video frames in a target video that require filter addition operations, and converts the video frames into target video frames in a preset format. The video frame is divided into blocks to obtain multiple sub-video frames. According to the arrangement order of the multiple sub-video frames, the gray value of the edge of the sub-video frame is dynamically set to the corresponding target gray value, and the sub-video frame The transparency of the edge is the corresponding target transparency. That is, in the present invention, filters are dynamically added to the sub-video frames obtained by splitting a video frame to increase the filter effect, thereby improving video special effects, improving video synthesis quality, and meeting the user's filter needs. In addition, in the present invention, converting the video frames into target video frames in a preset format can ensure that lossless filter processing effects are achieved when adding filter effects.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without exerting creative efforts.
图1为本发明实施例提供的一种视频帧处理方法的方法流程图;Figure 1 is a method flow chart of a video frame processing method provided by an embodiment of the present invention;
图2为本发明实施例提供的另一种视频帧处理方法的方法流程图;Figure 2 is a method flow chart of another video frame processing method provided by an embodiment of the present invention;
图3为本发明实施例提供的再一种视频帧处理方法的方法流程图;Figure 3 is a method flow chart of yet another video frame processing method provided by an embodiment of the present invention;
图4为本发明实施例提供的一种视频帧处理装置的结构示意图。Figure 4 is a schematic structural diagram of a video frame processing device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
目前,在对视频帧添加滤镜效果时,是对整张视频帧进行统一处理,滤镜效果单一,特效效果展示差,难以适应内容中的多元化需求,无法满足用户的滤镜需求。Currently, when adding filter effects to video frames, the entire video frame is processed uniformly. The filter effect is single, the special effects display is poor, and it is difficult to adapt to the diversified needs in the content and cannot meet the filter needs of users.
为了解决这一技术问题,发明人经过研究发现,可以将视频帧进行分块处理,对分块的子视频帧动态添加滤镜,增加滤镜效果,提高特效效果,满足多元化需求,进而满足用户的滤镜需求。In order to solve this technical problem, the inventor found through research that video frames can be divided into blocks, and filters can be dynamically added to the divided sub-video frames to increase filter effects, improve special effects, meet diversified needs, and then satisfy User filter requirements.
具体的,本发明实施例提供了一种视频帧处理方法、装置及电子设备,获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧,对所述目标视频帧进行分块,得到多个子视频帧,按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。即本发明中,对一个视频帧拆分得到的子视频帧动态添加滤镜,增加滤镜效果,进而提高视频特效,提高视频合成质量,满足用户的滤镜需求。另外,本发明中,将所述视频帧转化为预设格式的目标视频帧,能够保证在添加滤镜效果时,实现无损滤镜处理效果。Specifically, embodiments of the present invention provide a video frame processing method, device and electronic equipment to obtain video frames in a target video that require a filter addition operation, and convert the video frames into target video frames in a preset format. , divide the target video frame into blocks to obtain multiple sub-video frames, dynamically set the gray value of the edge of the sub-video frame to the corresponding target gray value according to the arrangement order of the multiple sub-video frames, and The transparency of the edge of the sub-video frame is the corresponding target transparency. That is, in the present invention, filters are dynamically added to the sub-video frames obtained by splitting a video frame to increase the filter effect, thereby improving video special effects, improving video synthesis quality, and meeting the user's filter needs. In addition, in the present invention, converting the video frames into target video frames in a preset format can ensure that lossless filter processing effects are achieved when adding filter effects.
在上述内容的基础上,本发明的另一实施例提供了一种视频帧处理方法,参照图1,可以包括:Based on the above content, another embodiment of the present invention provides a video frame processing method. Referring to Figure 1, it may include:
S11、获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧。S11. Obtain video frames in the target video that require filter addition operations, and convert the video frames into target video frames in a preset format.
其中,预设格式为预设PGM格式。Among them, the default format is the default PGM format.
本实施例中,可以对视频,本实施例中称为目标视频,中的视频帧依次添加滤镜操作。In this embodiment, filter operations can be added sequentially to the video frames in the video, which is called the target video in this embodiment.
针对目标视频中需要进行滤镜添加操作的视频帧,将所述视频帧转化为预设PGM格式的目标视频帧。For video frames in the target video that require a filter addition operation, convert the video frames into target video frames in a preset PGM format.
其中,PGM(存储和交换图像数据的简单文件格式之一)由两部分数据组成,分别是文件头部分和像素数据部分。Among them, PGM (one of the simple file formats for storing and exchanging image data) consists of two parts of data, namely the file header part and the pixel data part.
文件头部分中的第一行是以一个“Magic Number”来标识图片格式,这个magicnumber是P1,P2,P3,P4,P5,P6等模式。其中P1-P3模式的读取使用支持Ascii码格式读取,PIL只支持二进制格式的P4-P6模式的读取。The first line in the file header uses a "Magic Number" to identify the image format. This magic number is P1, P2, P3, P4, P5, P6 and other modes. The reading of P1-P3 mode supports Ascii code format reading, and PIL only supports the reading of P4-P6 mode in binary format.
第二行是图片宽度、图片高度。The second line is the image width and image height.
第三行是这个图片数据的最大值。The third line is the maximum value of this image data.
像素数据是以“row-major order”存放的,按行存放的。默认状况下。每行长度不能超过70个字符,安全的作法是每行存放一个像素。Pixel data is stored in "row-major order", by row. By default. Each line cannot be longer than 70 characters, and it is safe to store one pixel per line.
本实施例中,将视频帧的格式转换为预设PGM格式,是由于现有的jgp,png,bmp,yuv等格式文件只要对其进行处理,必然会有些像素点的值存在有损现象,而PGM文件的每个像素点的值是矢量的,能够达到无损滤镜。滤镜效果采用pgm格式,pgm格式前期就可以可视预览,可见即所得,后期给处理视频设置滤镜效果后又达到无损滤镜处理的效果。In this embodiment, the format of the video frame is converted to the preset PGM format because as long as the existing jgp, png, bmp, yuv and other format files are processed, the values of some pixels will inevitably be lossy. The value of each pixel in the PGM file is vector, which can achieve lossless filters. The filter effect uses the pgm format. The pgm format can be previewed in the early stage. What you see is what you get. After setting the filter effect on the video for processing, the effect of lossless filter processing can be achieved.
需要说明的是,预先可以设置滤镜效果图片,滤镜效果图片的模式可以是上述的P1,P2,P3,P4,P5,P6等模式,本实施例中的预设PGM格式,即为滤镜效果图片的模式,如P2。It should be noted that the filter effect picture can be set in advance. The mode of the filter effect picture can be the above-mentioned P1, P2, P3, P4, P5, P6 and other modes. The preset PGM format in this embodiment is the filter effect picture. Mirror effect picture mode, such as P2.
在将所述视频帧转化为预设格式的目标视频帧之后,还可以确定所述目标视频帧中的像素的灰度值。After converting the video frame into a target video frame in a preset format, the grayscale value of the pixels in the target video frame may also be determined.
在实际应用中,针对目标视频帧中的每一像素,确定其对应的灰度值。In practical applications, for each pixel in the target video frame, its corresponding gray value is determined.
具体的,确定所述目标视频帧中的像素的灰度值,可以包括:Specifically, determining the grayscale value of the pixel in the target video frame may include:
1)提取所述目标视频帧中的像素的预设通道的通道值,并对所述通道值进行修正操作,得到修正后的通道值。1) Extract the channel value of the preset channel of the pixel in the target video frame, and perform a correction operation on the channel value to obtain the corrected channel value.
具体的,针对目标视频帧中的像素,可以提取其预设通道的通道值。其中,预设通道可以是R、G、B通道。可以获取像素的RGBA通道图,然后从中提取出R、G、B值。然后对所述通道值进行修正操作,得到修正后的通道值。Specifically, for the pixels in the target video frame, the channel value of its preset channel can be extracted. Among them, the preset channels can be R, G, and B channels. You can obtain the RGBA channel map of the pixel and then extract the R, G, and B values from it. Then, a correction operation is performed on the channel value to obtain the corrected channel value.
其中,修正后的通道值为:Among them, the corrected channel value is:
Rlinear=pow(R,1/Gamma)Rlinear=pow(R,1/Gamma)
Glinear=pow(G,1/Gamma)Glinear=pow(G,1/Gamma)
Blinear=pow(B,1/Gamma);Blinear=pow(B,1/Gamma);
其中,Rlinear,Glinear,Blinear在[0,1]范围,Rlinear为修正后的R值,Glinear为修正后的G值,Blinear为修正后的B值。Gamma为固定值,如为2.2。Among them, Rlinear, Glinear, and Blinear are in the range of [0,1], Rlinear is the corrected R value, Glinear is the corrected G value, and Blinear is the corrected B value. Gamma is a fixed value, such as 2.2.
2)根据修正后的通道值,计算所述像素的线性校正值。2) Calculate the linear correction value of the pixel based on the corrected channel value.
具体的,像素的线性校正值Clinear为:Specifically, the linear correction value Clinear of the pixel is:
Clinear=0.2126Rlinear+0.7152Glinear+0.0722Blinear。Clinear=0.2126Rlinear+0.7152Glinear+0.0722Blinear.
3)确定所述线性校正值对应的灰度值,并作为所述像素的灰度值。3) Determine the gray value corresponding to the linear correction value and use it as the gray value of the pixel.
具体的,根据线性变换计算得到的上述线性校正值,根据线性Gamma校正公式进行校正,得到线性校正值对应的灰度值Csrgb,具体为:Specifically, the above linear correction value calculated according to the linear transformation is corrected according to the linear Gamma correction formula to obtain the grayscale value Csrgb corresponding to the linear correction value, specifically as follows:
Csrgb=12.92*Clinear,当Clinear<=0.0031308;Csrgb=12.92*Clinear, when Clinear<=0.0031308;
Csrgb=1.055*Clinear1/2.4-0.055,当Clinear>0.0031308Csrgb=1.055*Clinear1/2.4 -0.055, when Clinear>0.0031308
通过本步骤,即可得到每个像素点对应的像素值等于PGM输入的灰度图像灰度值。Through this step, it can be obtained that the pixel value corresponding to each pixel point is equal to the grayscale value of the grayscale image input by PGM.
本实施例中,确定所述线性校正值对应的灰度值,即为对图像进行灰度化处理。In this embodiment, determining the grayscale value corresponding to the linear correction value is to perform grayscale processing on the image.
需要说明的是,在执行确定所述目标视频帧中的像素的灰度值之后(具体为确定所述线性校正值对应的灰度值,并作为所述像素的灰度值之后),执行步骤S12之前,还可以对所述目标视频帧进行滤波操作。It should be noted that, after determining the grayscale value of the pixel in the target video frame (specifically, determining the grayscale value corresponding to the linear correction value and using it as the grayscale value of the pixel), perform the step Before S12, a filtering operation may also be performed on the target video frame.
在进行滤波时,可以采用高斯滤波,通过滤波,能够避免干扰。When filtering, Gaussian filtering can be used. Through filtering, interference can be avoided.
S12、对所述目标视频帧进行分块,得到多个子视频帧。S12. Divide the target video frame into blocks to obtain multiple sub-video frames.
具体地,将所述目标视频帧拆分为边长为预设长度的多个矩形图片,并将每一矩形图片作为一子视频帧,并基于所述预设长度,设置所述子视频帧边长的像素值。Specifically, the target video frame is split into multiple rectangular pictures with a side length of a preset length, each rectangular picture is treated as a sub-video frame, and based on the preset length, the sub-video frame is set The pixel value of the side length.
如,把为灰度图像的目标视频帧读取到像素阵列中,进行分块,将PGM全图分成变成边长为m(预设长度)的正方形,按列顺序生成子图,每一子图即为一子视频帧。For example, read the target video frame that is a grayscale image into a pixel array, divide it into blocks, divide the entire PGM image into squares with a side length of m (preset length), and generate sub-images in column order. Each A sub-picture is a sub-video frame.
子视频帧边长对应的区域像素p=m/原图分辨率大小。The area pixel corresponding to the side length of the sub-video frame is p=m/original image resolution size.
行和列方向上子视频帧的个数=原图分辨率大小/子图边长对应的像素(p)。The number of sub-video frames in the row and column directions = original image resolution size/pixels (p) corresponding to the side length of the sub-image.
子图块序号按照1、2、3、4……排列。The sub-tile serial numbers are arranged according to 1, 2, 3, 4...
S13、按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。S13. According to the arrangement order of the multiple sub-video frames, dynamically set the gray value of the edge of the sub-video frame to the corresponding target gray value, and the transparency of the edge of the sub-video frame to the corresponding target transparency.
在实际应用中,动态设置子视频帧的边缘的灰度值和透明度时,需要确定子视频帧的边缘的目标灰度值以及目标透明度,再进行动态滤镜添加操作。In practical applications, when dynamically setting the grayscale value and transparency of the edge of a sub-video frame, it is necessary to determine the target grayscale value and target transparency of the edge of the sub-video frame, and then add a dynamic filter.
即步骤S13包括:That is, step S13 includes:
1)确定所述子视频帧的边缘的目标灰度值以及目标透明度;1) Determine the target grayscale value and target transparency of the edge of the sub-video frame;
2)按照所述多个子视频帧的排列顺序,在不同的滤镜添加时间内,将所述滤镜添加时间对应的所述子视频帧的边缘的灰度值设置为所述目标灰度值,以及将所述子视频帧的边缘的透明度设置为所述目标透明度。2) According to the arrangement order of the plurality of sub-video frames, during different filter addition times, set the grayscale value of the edge of the sub-video frame corresponding to the filter addition time to the target grayscale value , and set the transparency of the edge of the sub-video frame to the target transparency.
其中,确定所述子视频帧的边缘的目标灰度值以及目标透明度的实现过程如下:The implementation process of determining the target grayscale value and target transparency of the edge of the sub-video frame is as follows:
本实施例中,在添加滤镜时,会对子视频帧的边缘的灰度值以及透明度进行调整,但是子视频帧的非边缘区域的灰度值和透明度值保持不变。In this embodiment, when adding a filter, the grayscale value and transparency of the edge of the sub-video frame are adjusted, but the grayscale value and transparency value of the non-edge area of the sub-video frame remain unchanged.
参照图2,确定所述子视频帧的边缘的目标灰度值以及目标透明度可以包括:Referring to Figure 2, determining the target gray value and target transparency of the edge of the sub-video frame may include:
S21、对所述子视频帧进行边缘检测处理,以确定所述子视频帧的边缘。S21. Perform edge detection processing on the sub-video frame to determine the edge of the sub-video frame.
本实施例中,可以使用canny算子进行子视频帧的边缘检测,得到子视频帧的边缘。In this embodiment, the canny operator can be used to perform edge detection of the sub-video frame to obtain the edge of the sub-video frame.
S22、获取在所述边缘的预设范围内的像素的灰度值。S22. Obtain the grayscale value of the pixel within the preset range of the edge.
具体的,为了在添加滤镜效果时,保证像素的灰度值变化自然,可以使用边缘附近的像素的灰度值对边缘的灰度值进行修正,使得边缘的灰度值变化自然。Specifically, in order to ensure that the gray value of a pixel changes naturally when adding a filter effect, the gray value of the pixel near the edge can be used to correct the gray value of the edge, so that the gray value of the edge changes naturally.
本实施例中的预设范围内的像素可以是处于边缘的像素的上下左右的四个像素。然后,获取这四个像素的灰度值。In this embodiment, the pixels within the preset range may be four pixels above, below, left and right of the pixel at the edge. Then, get the grayscale values of these four pixels.
S23、基于在所述边缘的预设范围内的像素的灰度值,对所述边缘的灰度值进行修正,得到所述子视频帧的边缘的目标灰度值。S23. Based on the grayscale value of the pixel within the preset range of the edge, correct the grayscale value of the edge to obtain the target grayscale value of the edge of the sub-video frame.
具体的,可以以边缘为分界线,对于处于边缘的像素,预先设置其周围的上下左右四个像素的灰度值的权重,然后将像素的灰度值与权重的乘积,作为子视频帧的边缘的目标灰度值。Specifically, the edge can be used as the dividing line. For the pixel on the edge, the weight of the gray value of the four surrounding pixels is preset, and then the product of the gray value of the pixel and the weight is used as the sub-video frame. The target gray value of the edge.
边缘内外的像素的灰度值与子视频帧对应位置的灰度保持一致。The gray value of the pixels inside and outside the edge is consistent with the gray value of the corresponding position in the sub-video frame.
S24、获取所述子视频帧的边缘的透明度,以及所述透明度所在的透明度区间的透明度系数。S24. Obtain the transparency of the edge of the sub-video frame and the transparency coefficient of the transparency interval where the transparency is located.
具体的,预先设置了透明度区间,不同的透明度区间对应不同的透明度系数区间,如[under,over]。其中,under为该区间的透明度系数最小值,over为该区间的透明度系数最大值。Specifically, the transparency interval is preset, and different transparency intervals correspond to different transparency coefficient intervals, such as [under, over]. Among them, under is the minimum value of the transparency coefficient in the interval, and over is the maximum value of the transparency coefficient in the interval.
本实施例中,获取所述子视频帧的边缘的透明度,然后确定透明度所在的透明度区间,然后确定该透明度区间对应的透明度系数under和over。In this embodiment, the transparency of the edge of the sub-video frame is obtained, and then the transparency interval where the transparency is located is determined, and then the transparency coefficients under and over corresponding to the transparency interval are determined.
S25、根据预设最大透明度值、所述子视频帧的边缘的透明度以及所述透明度系数,计算所述子视频帧的边缘的目标透明度。S25. Calculate the target transparency of the edge of the sub-video frame according to the preset maximum transparency value, the transparency of the edge of the sub-video frame and the transparency coefficient.
具体的,子视频帧的边缘的目标透明度为:Specifically, the target transparency of the edge of the sub-video frame is:
under*(1-(alpha/alpha_maxval))+over*(alpha/alpha_maxval)under*(1-(alpha/alpha_maxval))+over*(alpha/alpha_maxval)
其中,alpha_maxval为预设最大透明度值,alpha为子视频帧的边缘的透明度,under为透明度系数最小值,over为透明度系数最大值。Among them, alpha_maxval is the preset maximum transparency value, alpha is the transparency of the edge of the sub-video frame, under is the minimum transparency coefficient, and over is the maximum transparency coefficient.
本发明的另一实现方式中,按照所述多个子视频帧的排列顺序,在不同的滤镜添加时间内,将所述滤镜添加时间对应的所述子视频帧的边缘的灰度值设置为所述目标灰度值,以及将所述子视频帧的边缘的透明度设置为所述目标透明度的实现过程如下:In another implementation manner of the present invention, according to the arrangement order of the plurality of sub-video frames, during different filter adding times, the gray value of the edge of the sub-video frame corresponding to the filter adding time is set. is the target gray value, and the implementation process of setting the transparency of the edge of the sub-video frame to the target transparency is as follows:
本实施例中,不对整个目标视频帧统一进行滤镜添加操作,而是针对目标视频帧中的子视频帧,在不同的滤镜添加时间内,可以对不同的子视频帧进行滤镜添加操作。In this embodiment, the filter addition operation is not performed uniformly for the entire target video frame, but for the sub-video frames in the target video frame, the filter addition operation can be performed on different sub-video frames during different filter addition times. .
本实施例中,参照图3,“按照所述多个子视频帧的排列顺序,在不同的滤镜添加时间内,将所述滤镜添加时间对应的所述子视频帧的边缘的灰度值设置为所述目标灰度值,以及将所述子视频帧的边缘的透明度设置为所述目标透明度”具体包括:In this embodiment, referring to Figure 3, "According to the arrangement order of the multiple sub-video frames, at different filter adding times, the gray value of the edge of the sub-video frame corresponding to the filter adding time is "Set to the target grayscale value, and set the transparency of the edge of the sub-video frame to the target transparency" specifically includes:
S31、获取所述目标视频帧的滤镜添加总时间,并根据所述滤镜添加总时间以及所述子视频帧的数量,计算所述子视频帧的滤镜添加时间。S31. Obtain the total filter adding time of the target video frame, and calculate the filter adding time of the sub-video frame according to the total filter adding time and the number of the sub-video frames.
具体的,滤镜添加时间=滤镜添加总时间/子视频帧的数量。Specifically, filter addition time = total filter addition time/number of sub-video frames.
S32、按照所述多个子视频帧的排列顺序,确定每一滤镜添加时间对应的子视频帧。S32. Determine the sub-video frame corresponding to each filter addition time according to the arrangement order of the multiple sub-video frames.
本实施例中,在每一滤镜添加时间内,对哪一子视频帧进行滤镜操作,可以预先设定,如可以按子视频帧按列或行进行顺序设置。In this embodiment, during each filter adding time, which sub-video frame is to be filtered can be preset, for example, it can be set sequentially by column or row per sub-video frame.
S33、在不同的滤镜添加时间内,设置所述滤镜添加时间对应的所述子视频帧的边缘的灰度值为所述目标灰度值,以及设置所述子视频帧的边缘的透明度为所述目标透明度。S33. During different filter adding times, set the gray value of the edge of the sub-video frame corresponding to the filter adding time to the target gray value, and set the transparency of the edge of the sub-video frame. for the target transparency.
举例来说,1s内对30个子视频帧进行滤镜添加操作,则1/30s内,可以按列排序对第一个子视频帧进行滤镜操作。然后在2/30s内,可以对第二个子视频帧进行滤镜操作……,以此类推,直至30/30s内,对第三十个子视频帧进行滤镜操作。For example, if the filter operation is performed on 30 sub-video frames within 1 second, then within 1/30 seconds, the filter operation can be performed on the first sub-video frame in column order. Then within 2/30s, the filter operation can be performed on the second sub-video frame..., and so on, until within 30/30s, the filter operation can be performed on the thirtieth sub-video frame.
此外,还可以对至少一个子视频帧进行同时添加滤镜操作,如在1/30s内,可以对第一个子视频帧进行滤镜操作,在2/30s内,可以对第二个和第三个子视频帧同时进行滤镜操作……。在对第二个和第三个子视频帧同时进行滤镜操作时,可以采用并行滤镜添加操作,提高处理速度,降低耗时。In addition, a filter operation can be performed on at least one sub-video frame at the same time. For example, within 1/30s, a filter operation can be performed on the first sub-video frame, and within 2/30s, a filter operation can be performed on the second and third sub-video frames. Three sub-video frames are filtered simultaneously... When performing filter operations on the second and third sub-video frames at the same time, parallel filter addition operations can be used to increase processing speed and reduce time consumption.
其中,添加滤镜是指将子视频帧的边缘的灰度值设置为所述目标灰度值,以及将所述子视频帧的边缘的透明度设置为所述目标透明度。Wherein, adding a filter means setting the grayscale value of the edge of the sub-video frame to the target grayscale value, and setting the transparency of the edge of the sub-video frame to the target transparency.
即通过PGM像素值的变化改变视频帧图片颜色的梯度变化,进而达到视频‘轨迹’滤镜的效果。若是,更改上述的预设PGM格式,最终展示的滤镜效果也不一样。That is, the gradient change of the color of the video frame picture is changed through the change of PGM pixel value, thereby achieving the effect of the video 'track' filter. If so, if you change the default PGM format mentioned above, the final filter effect displayed will also be different.
在对本视频帧进行滤镜添加之后,可以对下一视频帧进行滤镜添加,以此类推,直至最后一个视频帧。After adding filters to this video frame, you can add filters to the next video frame, and so on, until the last video frame.
本实施例中,获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧,对所述目标视频帧进行分块,得到多个子视频帧,按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。即本发明中,对一个视频帧拆分得到的子视频帧动态添加滤镜,增加滤镜效果,进而提高视频特效,提高视频合成质量,满足用户的滤镜需求。另外,本发明中,将所述视频帧转化为预设格式的目标视频帧,能够保证在添加滤镜效果时,实现无损滤镜处理效果。In this embodiment, video frames in the target video that require filter addition operations are obtained, the video frames are converted into target video frames in a preset format, and the target video frames are divided into blocks to obtain multiple sub-video frames. , according to the arrangement order of the plurality of sub-video frames, dynamically set the gray value of the edge of the sub-video frame to the corresponding target gray value, and the transparency of the edge of the sub-video frame to the corresponding target transparency. That is, in the present invention, filters are dynamically added to the sub-video frames obtained by splitting a video frame to increase the filter effect, thereby improving video special effects, improving video synthesis quality, and meeting the user's filter needs. In addition, in the present invention, converting the video frames into target video frames in a preset format can ensure that lossless filter processing effects are achieved when adding filter effects.
此外,本实施例添加滤镜效率较高、且可编辑视频特效输出效果,能够降低特效的设计和研发成本,让视频特效更加丰富多样化,且保证最后的合成质量,提高编辑效率。此外,操作简单方便,易学易用。In addition, this embodiment is more efficient in adding filters and can edit video special effects output effects, which can reduce the design and development costs of special effects, make video special effects richer and more diverse, ensure the final synthesis quality, and improve editing efficiency. In addition, the operation is simple and convenient, easy to learn and use.
此外,在添加滤镜时,可以通过并行方式添加滤镜,提高效率和降低耗时。In addition, when adding filters, filters can be added in parallel to improve efficiency and reduce time consumption.
可选地,在上述视频帧处理方法的实施例的基础上,本发明的另一实施例提供了一种视频帧处理装置,参照图4,可以包括:Optionally, based on the above embodiment of the video frame processing method, another embodiment of the present invention provides a video frame processing device. Referring to Figure 4, it may include:
视频帧转化模块11,用于获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧;The video frame conversion module 11 is used to obtain video frames in the target video that require filter addition operations, and convert the video frames into target video frames in a preset format;
视频帧处理模块12,用于对所述目标视频帧进行分块,得到多个子视频帧;The video frame processing module 12 is used to divide the target video frame into blocks to obtain multiple sub-video frames;
滤镜处理模块13,用于按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。The filter processing module 13 is configured to dynamically set the grayscale value of the edge of the sub-video frame to the corresponding target grayscale value and the transparency of the edge of the sub-video frame according to the arrangement order of the multiple sub-video frames. is the corresponding target transparency.
进一步,还包括:Furthermore, it also includes:
通道值处理模块,用于提取所述目标视频帧中的像素的预设通道的通道值,并对所述通道值进行修正操作,得到修正后的通道值;The channel value processing module is used to extract the channel value of the preset channel of the pixel in the target video frame, and perform a correction operation on the channel value to obtain the corrected channel value;
校正模块,用于根据修正后的通道值,计算所述像素的线性校正值;A correction module, used to calculate the linear correction value of the pixel based on the corrected channel value;
灰度值确定模块,用于确定所述线性校正值对应的灰度值,并作为所述像素的灰度值。A grayscale value determination module is used to determine the grayscale value corresponding to the linear correction value and use it as the grayscale value of the pixel.
进一步,还包括:Furthermore, it also includes:
滤镜模块,用于对所述目标视频帧进行滤波操作。A filter module is used to perform filtering operations on the target video frame.
进一步,所述视频帧处理模块具体用于:Further, the video frame processing module is specifically used for:
将所述目标视频帧拆分为边长为预设长度的多个矩形图片,并将每一矩形图片作为一子视频帧,基于所述预设长度,设置所述子视频帧边长的像素值。Split the target video frame into multiple rectangular pictures with a side length of a preset length, and treat each rectangular picture as a sub-video frame. Based on the preset length, set the pixels of the side length of the sub-video frame. value.
进一步,滤镜处理模块13包括:Further, the filter processing module 13 includes:
数据确定子模块,用于确定所述子视频帧的边缘的目标灰度值以及目标透明度;Data determination submodule, used to determine the target gray value and target transparency of the edge of the sub-video frame;
滤镜添加子模块,用于按照所述多个子视频帧的排列顺序,在不同的滤镜添加时间内,将所述滤镜添加时间对应的所述子视频帧的边缘的灰度值设置为所述目标灰度值,以及将所述子视频帧的边缘的透明度设置为所述目标透明度。The filter adding sub-module is used to set the grayscale value of the edge of the sub-video frame corresponding to the filter adding time at different filter adding times according to the arrangement order of the multiple sub-video frames. The target grayscale value, and the transparency of the edge of the sub-video frame is set to the target transparency.
进一步,数据确定子模块包括:Further, the data determination sub-module includes:
对所述子视频帧进行边缘检测处理,以确定所述子视频帧的边缘;Perform edge detection processing on the sub-video frame to determine the edge of the sub-video frame;
灰度值获取单元,用于获取在所述边缘的预设范围内的像素的灰度值;A grayscale value acquisition unit, configured to obtain the grayscale value of a pixel within a preset range of the edge;
修正单元,用于基于在所述边缘的预设范围内的像素的灰度值,对所述边缘的灰度值进行修正,得到所述子视频帧的边缘的目标灰度值;A correction unit configured to correct the gray value of the edge based on the gray value of the pixel within the preset range of the edge to obtain the target gray value of the edge of the sub-video frame;
透明度处理单元,用于获取所述子视频帧的边缘的透明度,以及所述透明度所在的透明度区间的透明度系数;A transparency processing unit, configured to obtain the transparency of the edge of the sub-video frame and the transparency coefficient of the transparency interval where the transparency is located;
透明度计算单元,用于根据预设最大透明度值、所述子视频帧的边缘的透明度以及所述透明度系数,计算所述子视频帧的边缘的目标透明度。A transparency calculation unit configured to calculate the target transparency of the edge of the sub-video frame based on the preset maximum transparency value, the transparency of the edge of the sub-video frame, and the transparency coefficient.
进一步,滤镜添加子模块包括:Further, the filter adding sub-module includes:
时间处理单元,用于获取所述视频的滤镜添加总时间,并根据所述滤镜添加总时间以及所述子视频帧的数量,计算所述子视频帧的滤镜添加时间;A time processing unit, configured to obtain the total filter adding time of the video, and calculate the filter adding time of the sub-video frame according to the total filter adding time and the number of the sub-video frames;
视频帧确定单元,用于按照所述多个子视频帧的排列顺序,确定每一滤镜添加时间对应的子视频帧;A video frame determination unit, configured to determine the sub-video frame corresponding to each filter addition time according to the arrangement order of the plurality of sub-video frames;
滤镜添加单元,用于在不同的滤镜添加时间内,设置所述滤镜添加时间对应的所述子视频帧的边缘的灰度值为所述目标灰度值,以及设置所述子视频帧的边缘的透明度为所述目标透明度。A filter adding unit, configured to set the grayscale value of the edge of the sub-video frame corresponding to the filter adding time to the target grayscale value during different filter adding times, and set the sub-video The transparency of the frame's edges is the target transparency.
本实施例中,获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧,对所述目标视频帧进行分块,得到多个子视频帧,按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。即本发明中,对一个视频帧拆分得到的子视频帧动态添加滤镜,增加滤镜效果,进而提高视频特效,提高视频合成质量,满足用户的滤镜需求。另外,本发明中,将所述视频帧转化为预设格式的目标视频帧,能够保证在添加滤镜效果时,实现无损滤镜处理效果。In this embodiment, video frames in the target video that require filter addition operations are obtained, the video frames are converted into target video frames in a preset format, and the target video frames are divided into blocks to obtain multiple sub-video frames. , according to the arrangement order of the plurality of sub-video frames, dynamically set the gray value of the edge of the sub-video frame to the corresponding target gray value, and the transparency of the edge of the sub-video frame to the corresponding target transparency. That is, in the present invention, filters are dynamically added to the sub-video frames obtained by splitting a video frame to increase the filter effect, thereby improving video special effects, improving video synthesis quality, and meeting the user's filter needs. In addition, in the present invention, converting the video frames into target video frames in a preset format can ensure that lossless filter processing effects are achieved when adding filter effects.
此外,本实施例添加滤镜效率较高、且可编辑视频特效输出效果,能够降低特效的设计和研发成本,让视频特效更加丰富多样化,且保证最后的合成质量,提高编辑效率。此外,操作简单方便,易学易用。In addition, this embodiment is more efficient in adding filters and can edit video special effects output effects, which can reduce the design and development costs of special effects, make video special effects richer and more diverse, ensure the final synthesis quality, and improve editing efficiency. In addition, the operation is simple and convenient, easy to learn and use.
此外,在添加滤镜时,可以通过并行方式添加滤镜,提高效率和降低耗时。In addition, when adding filters, filters can be added in parallel to improve efficiency and reduce time consumption.
需要说明的是,本实施例中的各个模块、子模块和单元的工作过程,请参照上述实施例中的相应说明,在此不再赘述。It should be noted that, for the working process of each module, sub-module and unit in this embodiment, please refer to the corresponding description in the above embodiment, and will not be described again here.
可选地,在上述视频帧处理方法及装置的实施例的基础上,本发明的另一实施例提供了一种电子设备,包括:存储器和处理器;Optionally, based on the above embodiments of the video frame processing method and device, another embodiment of the present invention provides an electronic device, including: a memory and a processor;
其中,所述存储器用于存储程序;Wherein, the memory is used to store programs;
处理器调用程序并用于执行上述的视频帧处理方法。The processor calls the program and is used to execute the above video frame processing method.
本实施例中,获取目标视频中需要进行滤镜添加操作的视频帧,并将所述视频帧转化为预设格式的目标视频帧,对所述目标视频帧进行分块,得到多个子视频帧,按照所述多个子视频帧的排列顺序,动态设置所述子视频帧的边缘的灰度值为对应的目标灰度值,以及所述子视频帧的边缘的透明度为对应的目标透明度。即本发明中,对一个视频帧拆分得到的子视频帧动态添加滤镜,增加滤镜效果,进而提高视频特效,提高视频合成质量,满足用户的滤镜需求。另外,本发明中,将所述视频帧转化为预设格式的目标视频帧,能够保证在添加滤镜效果时,实现无损滤镜处理效果。In this embodiment, video frames in the target video that require filter addition operations are obtained, the video frames are converted into target video frames in a preset format, and the target video frames are divided into blocks to obtain multiple sub-video frames. , according to the arrangement order of the plurality of sub-video frames, dynamically set the gray value of the edge of the sub-video frame to the corresponding target gray value, and the transparency of the edge of the sub-video frame to the corresponding target transparency. That is, in the present invention, filters are dynamically added to the sub-video frames obtained by splitting a video frame to increase the filter effect, thereby improving video special effects, improving video synthesis quality, and meeting the user's filter needs. In addition, in the present invention, converting the video frames into target video frames in a preset format can ensure that lossless filter processing effects are achieved when adding filter effects.
此外,本实施例添加滤镜效率较高、且可编辑视频特效输出效果,能够降低特效的设计和研发成本,让视频特效更加丰富多样化,且保证最后的合成质量,提高编辑效率。此外,操作简单方便,易学易用。In addition, this embodiment is more efficient in adding filters and can edit video special effects output effects, which can reduce the design and development costs of special effects, make video special effects richer and more diverse, ensure the final synthesis quality, and improve editing efficiency. In addition, the operation is simple and convenient, easy to learn and use.
此外,在添加滤镜时,可以通过并行方式添加滤镜,提高效率和降低耗时。In addition, when adding filters, filters can be added in parallel to improve efficiency and reduce time consumption.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables those skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be practiced in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210224376.5ACN114598902B (en) | 2022-03-09 | 2022-03-09 | Video frame processing method and device and electronic equipment |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210224376.5ACN114598902B (en) | 2022-03-09 | 2022-03-09 | Video frame processing method and device and electronic equipment |
| Publication Number | Publication Date |
|---|---|
| CN114598902A CN114598902A (en) | 2022-06-07 |
| CN114598902Btrue CN114598902B (en) | 2023-12-22 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210224376.5AActiveCN114598902B (en) | 2022-03-09 | 2022-03-09 | Video frame processing method and device and electronic equipment |
| Country | Link |
|---|---|
| CN (1) | CN114598902B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105338403A (en)* | 2014-08-06 | 2016-02-17 | 腾讯科技(北京)有限公司 | Filter processing method and device as well as electronic equipment |
| CN106550244A (en)* | 2015-09-16 | 2017-03-29 | 广州市动景计算机科技有限公司 | The picture quality enhancement method and device of video image |
| CN106921840A (en)* | 2015-12-25 | 2017-07-04 | 掌赢信息科技(上海)有限公司 | Method for beautifying faces, equipment and system in a kind of instant video |
| CN106920211A (en)* | 2017-03-09 | 2017-07-04 | 广州四三九九信息科技有限公司 | U.S. face processing method, device and terminal device |
| CN106971165A (en)* | 2017-03-29 | 2017-07-21 | 武汉斗鱼网络科技有限公司 | The implementation method and device of a kind of filter |
| CN107592475A (en)* | 2017-09-20 | 2018-01-16 | 北京奇虎科技有限公司 | Video data handling procedure and device, computing device |
| CN110062252A (en)* | 2019-04-30 | 2019-07-26 | 广州酷狗计算机科技有限公司 | Live broadcasting method, device, terminal and storage medium |
| CN112019762A (en)* | 2020-07-23 | 2020-12-01 | 北京迈格威科技有限公司 | Video processing method and device, storage medium and electronic equipment |
| CN112954459A (en)* | 2021-03-04 | 2021-06-11 | 网易(杭州)网络有限公司 | Video data processing method and device |
| CN113055712A (en)* | 2021-03-08 | 2021-06-29 | 快媒数字科技有限公司 | Multi-screen splicing display method and system |
| CN114025105A (en)* | 2021-12-15 | 2022-02-08 | 北京达佳互联信息技术有限公司 | Video processing method and device, electronic equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060002475A1 (en)* | 2004-07-02 | 2006-01-05 | Fuchs Robert J | Caching data for video edge filtering |
| US7649531B2 (en)* | 2004-09-06 | 2010-01-19 | Panasonic Corporation | Image generation device and image generation method |
| US8964853B2 (en)* | 2011-02-23 | 2015-02-24 | Qualcomm Incorporated | Multi-metric filtering |
| CN109379625B (en)* | 2018-11-27 | 2020-05-19 | Oppo广东移动通信有限公司 | Video processing method, apparatus, electronic device and computer readable medium |
| CN110675310B (en)* | 2019-07-02 | 2020-10-02 | 北京达佳互联信息技术有限公司 | Video processing method and device, electronic equipment and storage medium |
| CN111601033A (en)* | 2020-04-27 | 2020-08-28 | 北京小米松果电子有限公司 | Video processing method, device and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105338403A (en)* | 2014-08-06 | 2016-02-17 | 腾讯科技(北京)有限公司 | Filter processing method and device as well as electronic equipment |
| CN106550244A (en)* | 2015-09-16 | 2017-03-29 | 广州市动景计算机科技有限公司 | The picture quality enhancement method and device of video image |
| CN106921840A (en)* | 2015-12-25 | 2017-07-04 | 掌赢信息科技(上海)有限公司 | Method for beautifying faces, equipment and system in a kind of instant video |
| CN106920211A (en)* | 2017-03-09 | 2017-07-04 | 广州四三九九信息科技有限公司 | U.S. face processing method, device and terminal device |
| CN106971165A (en)* | 2017-03-29 | 2017-07-21 | 武汉斗鱼网络科技有限公司 | The implementation method and device of a kind of filter |
| CN107592475A (en)* | 2017-09-20 | 2018-01-16 | 北京奇虎科技有限公司 | Video data handling procedure and device, computing device |
| CN110062252A (en)* | 2019-04-30 | 2019-07-26 | 广州酷狗计算机科技有限公司 | Live broadcasting method, device, terminal and storage medium |
| CN112019762A (en)* | 2020-07-23 | 2020-12-01 | 北京迈格威科技有限公司 | Video processing method and device, storage medium and electronic equipment |
| CN112954459A (en)* | 2021-03-04 | 2021-06-11 | 网易(杭州)网络有限公司 | Video data processing method and device |
| CN113055712A (en)* | 2021-03-08 | 2021-06-29 | 快媒数字科技有限公司 | Multi-screen splicing display method and system |
| CN114025105A (en)* | 2021-12-15 | 2022-02-08 | 北京达佳互联信息技术有限公司 | Video processing method and device, electronic equipment and storage medium |
| Title |
|---|
| 一种面向多投影显示的全景视频分块编码方法;梅元乔;姜忠鼎;;计算机应用与软件(03);全文* |
| 浅谈会声会影视频滤镜效果及编辑技巧;赵元元;;数码世界(12);全文* |
| Publication number | Publication date |
|---|---|
| CN114598902A (en) | 2022-06-07 |
| Publication | Publication Date | Title |
|---|---|---|
| TWI520598B (en) | Image processing apparatus and image processing method | |
| US8164662B2 (en) | Image-processing device for color image data and method for the image processing of color image data | |
| US20070237425A1 (en) | Image resolution increasing method and apparatus for the same | |
| CN102291531A (en) | Image processing apparatus, image processing method, and program | |
| US9911177B2 (en) | Applying chroma suppression to image data in a scaler of an image processing pipeline | |
| CN112929672B (en) | Video compression method, device, equipment and computer readable storage medium | |
| US10178359B2 (en) | Macropixel processing system, method and article | |
| US20070263939A1 (en) | Variable length decoding device, variable length decoding method and image capturing system | |
| WO2014008329A1 (en) | System and method to enhance and process a digital image | |
| US20110157465A1 (en) | Look up table update method | |
| US7184087B2 (en) | On-screen device for subject of interest in portable electronic device, and method of controlling same | |
| CN114598902B (en) | Video frame processing method and device and electronic equipment | |
| US9619864B2 (en) | Image processing apparatus and method for increasing sharpness of images | |
| CN100356405C (en) | Method and apparatus for changing digital image size | |
| CN111105356B (en) | Image processing method, device and computer readable storage medium | |
| CN107886479A (en) | A kind of image HDR conversion methods, device, picture processing chip and storage device | |
| US9898831B2 (en) | Macropixel processing system, method and article | |
| CN108881923B (en) | Method for reducing buffer capacity of JPEG coding and decoding line | |
| WO2011121563A1 (en) | Detecting saliency in an image | |
| CN116362960A (en) | Image pixelation method based on scale-down algorithm and color distribution filter | |
| CN115689879A (en) | Image reduction method, device, terminal and storage medium | |
| CN103474049B (en) | Image processing apparatus and image processing method | |
| US8279240B2 (en) | Video scaling techniques | |
| US10068342B2 (en) | Macropixel processing system, method and article | |
| US9811920B2 (en) | Macropixel processing system, method and article |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information | Address after:247100 intersection of Fengming Avenue and Hanjiang Road, Jiangnan industrial concentration area, Chizhou City, Anhui Province Applicant after:Anhui Wenxiang Technology Co.,Ltd. Address before:247100 intersection of Fengming Avenue and Hanjiang Road, Jiangnan industrial concentration area, Chizhou City, Anhui Province Applicant before:Anhui Wenxiang Technology Co.,Ltd. | |
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
| PE01 | Entry into force of the registration of the contract for pledge of patent right | Denomination of invention:A video frame processing method, device, and electronic device Granted publication date:20231222 Pledgee:Anhui Jiangnan Industrial Concentration Zone Construction Investment Development (Group) Co.,Ltd. Pledgor:Anhui Wenxiang Technology Co.,Ltd. Registration number:Y2024980010811 | |
| PC01 | Cancellation of the registration of the contract for pledge of patent right | ||
| PC01 | Cancellation of the registration of the contract for pledge of patent right | Granted publication date:20231222 Pledgee:Anhui Jiangnan Industrial Concentration Zone Construction Investment Development (Group) Co.,Ltd. Pledgor:Anhui Wenxiang Technology Co.,Ltd. Registration number:Y2024980010811 |