CN112819699B - Video processing method, device and electronic equipment - Google Patents
Video processing method, device and electronic equipment Download PDFInfo
- Publication number
- CN112819699B CN112819699B CN201911118706.7A CN201911118706A CN112819699B CN 112819699 B CN112819699 B CN 112819699B CN 201911118706 A CN201911118706 A CN 201911118706A CN 112819699 B CN112819699 B CN 112819699B
- Authority
- CN
- China
- Prior art keywords
- image frame
- original image
- area
- pixel
- video
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4053—Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
Abstract
本发明涉及视频处理方法、装置及电子设备。该方法包括:获取第一视频中的原始图像帧;在原始图像帧中确定出第一区域,其中,原始图像帧包括第一区域和第二区域,原始图像帧中的第一区域处于欠曝状态,原始图像帧中的第二区域未处于欠曝状态;对原始图像帧进行增强处理,得到目标图像帧,其中,增强处理用于将图像中不同区域的曝光状态调整至曝光正常状态,目标图像帧中的第一区域和第二区域均处于曝光正常状态;根据目标图像帧,生成第二视频。
The present invention relates to a video processing method, device and electronic device. The method comprises: obtaining an original image frame in a first video; determining a first area in the original image frame, wherein the original image frame comprises a first area and a second area, the first area in the original image frame is in an underexposed state, and the second area in the original image frame is not in an underexposed state; performing enhancement processing on the original image frame to obtain a target image frame, wherein the enhancement processing is used to adjust the exposure state of different areas in the image to a normal exposure state, and the first area and the second area in the target image frame are both in a normal exposure state; and generating a second video according to the target image frame.
Description
技术领域Technical Field
本发明涉及视频处理技术领域,更具体地,涉及一种视频处理方法、一种视频处理装置、一种电子设备以及一种计算机可读存储介质。The present invention relates to the field of video processing technology, and more specifically, to a video processing method, a video processing device, an electronic device and a computer-readable storage medium.
背景技术Background Art
受时间久远、技术受限等因素的影响,老电影、老电视剧等老旧影片的播放质量不甚理想,例如存在图像不清、播放不流畅等问题。因此,需要对老旧影片进行处理以提升其播放质量。Due to factors such as time and technical limitations, the playback quality of old movies, old TV series, and other old videos is not ideal, such as unclear images and unsmooth playback. Therefore, it is necessary to process old videos to improve their playback quality.
人工修复老旧影片的方式费时费力、成本较高、处理结果不稳定,尤其难以适用于老电视剧等时长较长的老旧影片。如果基于图像处理等算法对老旧影片进行自动处理,则需要提出一种能够从整体上提升老旧影片播放质量的技术方案。The manual restoration of old films is time-consuming, labor-intensive, costly, and unstable, especially for old films with long durations, such as old TV series. If old films are automatically processed based on algorithms such as image processing, a technical solution that can improve the playback quality of old films as a whole needs to be proposed.
发明内容Summary of the invention
本发明的一个目的是提供一种视频处理的新技术方案。An object of the present invention is to provide a new technical solution for video processing.
根据本发明的第一方面,提供了一种视频处理方法,包括:According to a first aspect of the present invention, there is provided a video processing method, comprising:
获取第一视频中的原始图像帧;Obtaining an original image frame in a first video;
在所述原始图像帧中确定出第一区域,其中,所述原始图像帧包括第一区域和第二区域,所述原始图像帧中的第一区域处于欠曝状态,所述原始图像帧中的第二区域未处于欠曝状态;Determining a first area in the original image frame, wherein the original image frame includes a first area and a second area, the first area in the original image frame is in an underexposed state, and the second area in the original image frame is not in an underexposed state;
对所述原始图像帧进行增强处理,得到目标图像帧,其中,所述增强处理用于将图像中不同区域的曝光状态调整至曝光正常状态,所述目标图像帧中的第一区域和第二区域均处于曝光正常状态;Performing enhancement processing on the original image frame to obtain a target image frame, wherein the enhancement processing is used to adjust the exposure status of different areas in the image to a normal exposure state, and the first area and the second area in the target image frame are both in the normal exposure state;
根据所述目标图像帧,生成第二视频。A second video is generated according to the target image frame.
可选地,所述对所述原始图像帧进行增强处理,得到目标图像帧,包括:Optionally, the performing enhancement processing on the original image frame to obtain a target image frame includes:
通过对所述原始图像帧进行对比度增强处理,得到辅助图像帧,其中,所述辅助图像帧中的第一区域处于曝光正常状态,所述辅助图形帧中的第二区域处于过曝状态;By performing contrast enhancement processing on the original image frame, an auxiliary image frame is obtained, wherein a first area in the auxiliary image frame is in a normal exposure state, and a second area in the auxiliary image frame is in an overexposed state;
对所述原始图像帧和所述辅助图像帧进行图像融合,得到所述目标图像帧。The original image frame and the auxiliary image frame are subjected to image fusion to obtain the target image frame.
可选地,所述对所述原始图像帧和所述辅助图像帧进行融合,得到所述目标图像帧,包括:Optionally, the fusing the original image frame and the auxiliary image frame to obtain the target image frame includes:
获取所述原始图像的光照权重信息,其中,所述光照权重信息用于指示所述原始图像中的每个像素点对应的光照权重,所述光照权重与对应像素点的亮度相关;Acquire illumination weight information of the original image, wherein the illumination weight information is used to indicate an illumination weight corresponding to each pixel in the original image, and the illumination weight is related to the brightness of the corresponding pixel;
根据所述光照权重信息对所述原始图像和所述辅助图像帧进行图像融合,得到所述目标图像帧。The original image and the auxiliary image frame are fused according to the illumination weight information to obtain the target image frame.
可选地,在通过对所述原始图像帧进行对比度增强处理,得到辅助图像帧之前,所述方法还包括:Optionally, before obtaining the auxiliary image frame by performing contrast enhancement processing on the original image frame, the method further includes:
对所述原始图像帧进行去噪处理,得到更新后的原始图像帧,其中,所述去噪处理用于降低图像的噪声;Performing denoising processing on the original image frame to obtain an updated original image frame, wherein the denoising processing is used to reduce image noise;
基于所述更新后的原始图像帧,执行所述通过对所述原始图像帧进行对比度增强处理,得到辅助图像帧的步骤。Based on the updated original image frame, the step of obtaining the auxiliary image frame by performing contrast enhancement processing on the original image frame is performed.
可选地,在通过对所述原始图像帧进行对比度增强处理,得到辅助图像帧之前,所述方法包括:Optionally, before obtaining the auxiliary image frame by performing contrast enhancement processing on the original image frame, the method includes:
对所述原始图像帧进行边缘增强处理,得到更新后的原始图像帧,其中,所述边缘增强处理用于提升图像中轮廓边缘的清晰度;Performing edge enhancement processing on the original image frame to obtain an updated original image frame, wherein the edge enhancement processing is used to improve the clarity of the contour edge in the image;
基于更新后的所述原始图像帧,执行通过对所述原始图像帧进行对比度增强处理,得到辅助图像帧的步骤。Based on the updated original image frame, a step of obtaining an auxiliary image frame by performing contrast enhancement processing on the original image frame is performed.
可选地,在所述对所述原始图像帧和所述辅助图像帧进行融合,得到所述目标图像帧之后,所述方法还包括:Optionally, after fusing the original image frame and the auxiliary image frame to obtain the target image frame, the method further includes:
对所述目标图像帧进行超分辨率处理,其中,所述超分辨率处理用于提高图像的分辨率。The target image frame is subjected to super-resolution processing, wherein the super-resolution processing is used to improve the resolution of the image.
可选地,在所述根据所述目标图像帧,生成第二视频之后,还包括:Optionally, after generating the second video according to the target image frame, the method further includes:
对所述第二视频进行超帧率处理,得到用于播放的第三视频,其中,所述超帧率处理用于提高视频的帧率。The second video is subjected to super frame rate processing to obtain a third video for playback, wherein the super frame rate processing is used to increase the frame rate of the video.
根据本发明的第二方面,提供了一种视频处理装置,包括:According to a second aspect of the present invention, there is provided a video processing device, comprising:
图像提取模块,用于获取第一视频中的原始图像帧;An image extraction module, used to obtain an original image frame in the first video;
图像分析模块,用于在所述原始图像帧中确定出第一区域,其中,所述原始图像帧包括第一区域和第二区域,所述原始图像帧中的第一区域处于欠曝状态,所述原始图像帧中的第二区域未处于欠曝状态;An image analysis module, configured to determine a first area in the original image frame, wherein the original image frame includes a first area and a second area, the first area in the original image frame is in an underexposed state, and the second area in the original image frame is not in an underexposed state;
增强处理模块,用于对所述原始图像帧进行增强处理,得到目标图像帧,其中,所述增强处理用于将图像中不同区域的曝光状态调整至曝光正常状态,所述目标图像帧中的第一区域和第二区域均处于曝光正常状态;an enhancement processing module, configured to perform enhancement processing on the original image frame to obtain a target image frame, wherein the enhancement processing is used to adjust the exposure status of different areas in the image to a normal exposure status, and the first area and the second area in the target image frame are both in a normal exposure status;
视频生成模块,用于根据所述目标图像帧,生成第二视频。The video generation module is used to generate a second video according to the target image frame.
根据本发明的第三方面,提供了一种电子设备,包括:According to a third aspect of the present invention, there is provided an electronic device, comprising:
存储器,用于存储可执行命令;A memory for storing executable commands;
处理器,用于在所述可执行命令的控制下,执行本发明第一方面所述的方法。The processor is used to execute the method described in the first aspect of the present invention under the control of the executable command.
根据本发明的第四方面,提供了一种计算机可读存储介质,其特征在于,存储有可执行命令,所述可执行命令被处理器执行时,实现本发明第一方面所述的方法。According to a fourth aspect of the present invention, there is provided a computer-readable storage medium, characterized in that executable commands are stored therein, and when the executable commands are executed by a processor, the method described in the first aspect of the present invention is implemented.
本实施例中的视频处理方法,通过对原始图像帧进行增强处理,将原始图像帧中的欠曝区域调整为曝光正常状态的同时,还防止原始图像帧中曝光正常状态的区域出现过曝,有利于提升视频的图像质量。The video processing method in this embodiment enhances the original image frame to adjust the underexposed area in the original image frame to a normally exposed state, while preventing the area in the normally exposed state in the original image frame from being overexposed, which is beneficial to improving the image quality of the video.
通过以下参照附图对本发明的示例性实施例的详细描述,本发明的其它特征及其优点将会变得清楚。Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
被结合在说明书中并构成说明书的一部分的附图示出了本发明的实施例,并且连同其说明一起用于解释本发明的原理。The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
图1示出了可用于实现本发明实施例的电子设备的示意图。FIG. 1 is a schematic diagram showing an electronic device that can be used to implement an embodiment of the present invention.
图2示出了根据本发明实施例的视频处理方法的流程图。FIG. 2 shows a flow chart of a video processing method according to an embodiment of the present invention.
图3示出了根据本发明实施例的视频处理方法的具体例子的流程图。FIG. 3 shows a flowchart of a specific example of a video processing method according to an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
现在将参照附图来详细描述本发明的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本发明的范围。Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本发明及其应用或使用的任何限制。The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,技术、方法和设备应当被视为说明书的一部分。Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
在这里示出和讨论的所有例子中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它例子可以具有不同的值。In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
<硬件配置><Hardware Configuration>
图1示出了可用于实现本发明实施例的电子设备的硬件配置的示意图。FIG. 1 is a schematic diagram showing a hardware configuration of an electronic device that can be used to implement an embodiment of the present invention.
电子设备1100可以是便携式电脑、台式计算机、平板电脑等。The electronic device 1100 may be a portable computer, a desktop computer, a tablet computer, etc.
如图1所示,电子设备1100可以包括处理器1110、存储器1120、接口装置1130、通信装置1140、显示装置1150和输入装置1160。处理器1110可以是中央处理器CPU、微处理器MCU等。存储器1120例如包括ROM(只读存储器)、RAM(随机存取存储器)、诸如硬盘的非易失性存储器等。接口装置1130例如包括USB接口、耳机接口等。通信装置1140例如能够进行有线或无线通信。显示装置1150例如是液晶显示屏、触摸显示屏等。输入装置1160例如可以包括触摸屏、键盘等。As shown in FIG1 , the electronic device 1100 may include a processor 1110, a memory 1120, an interface device 1130, a communication device 1140, a display device 1150, and an input device 1160. The processor 1110 may be a central processing unit CPU, a microprocessor MCU, etc. The memory 1120 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1130 may include, for example, a USB interface, a headphone interface, etc. The communication device 1140 may be capable of wired or wireless communication, for example. The display device 1150 may be, for example, a liquid crystal display screen, a touch display screen, etc. The input device 1160 may include, for example, a touch screen, a keyboard, etc.
应用于本说明书的实施例中,电子设备1100的存储器1120用于存储指令,该指令用于控制处理器1110进行操作以支持实现根据本说明书任意实施例的视频处理方法。技术人员可以根据本说明书所公开方案设计指令。指令如何控制处理器进行操作,这是本领域公知,故在此不再详细描述。In the embodiments of this specification, the memory 1120 of the electronic device 1100 is used to store instructions, which are used to control the processor 1110 to operate to support the implementation of the video processing method according to any embodiment of this specification. The technician can design instructions according to the scheme disclosed in this specification. How the instructions control the processor to operate is well known in the art, so it will not be described in detail here.
本领域技术人员应当理解,尽管在图1中示出了电子设备1100的多个装置,但是,本说明书实施例的电子设备1100可以仅涉及其中的部分装置,例如,只涉及处理器1110、存储器1120、显示装置1150、输入装置1160等。Those skilled in the art should understand that, although multiple devices of the electronic device 1100 are shown in FIG1 , the electronic device 1100 of the embodiment of the present specification may involve only some of the devices, for example, only the processor 1110, the memory 1120, the display device 1150, the input device 1160, etc.
图1所示的电子设备1100仅是解释性的,并且决不是为了要限制本说明书、其应用或用途。The electronic device 1100 shown in FIG. 1 is merely illustrative and is in no way intended to limit the present description, its application, or uses.
<方法实施例><Method Example>
本实施例提供了一种视频处理方法,该方法例如由图1中的电子设备1100实施。如图2所示,该方法包括以下步骤S1100-S1400。This embodiment provides a video processing method, which is implemented by, for example, the electronic device 1100 in Fig. 1. As shown in Fig. 2, the method includes the following steps S1100-S1400.
在步骤S1100中,获取第一视频中的原始图像帧。In step S1100, an original image frame in a first video is obtained.
本实施例中,第一视频是需要进行画质提升的视频,例如是老电影、老电视剧等类型的视频。In this embodiment, the first video is a video that needs to have its image quality enhanced, such as an old movie, an old TV series, or the like.
图像帧是组成视频的最小单位。一个图像帧是一幅静止图片。基于人眼的视觉暂留效应,将多个图像帧按顺序快速播放可以形成视频。本实施例中的原始图像帧是用于形成第一视频的图像帧,其数量为多个。An image frame is the smallest unit that constitutes a video. An image frame is a still picture. Based on the visual persistence effect of the human eye, a video can be formed by playing multiple image frames in sequence quickly. The original image frame in this embodiment is an image frame used to form the first video, and the number of the original image frame is multiple.
本实施例中,可以利用专门的视频处理工具,获取第一视频中的原始图像帧。例如,可以利用视频处理软件FFmpeg将视频切割为多个图像帧。FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。它提供了录制、转换以及流化音视频的完整解决方案。在一个例子中,通过FFmpeg软件中的“ffmpeg-i video.mpgimage%d.jpg”命令,可以将视频分解成图片序列,从而得到第一视频中的原始图像帧。In this embodiment, a special video processing tool can be used to obtain the original image frames in the first video. For example, the video processing software FFmpeg can be used to cut the video into multiple image frames. FFmpeg is an open source computer program that can be used to record and convert digital audio and video and convert them into streams. It provides a complete solution for recording, converting and streaming audio and video. In one example, the video can be decomposed into a sequence of pictures through the "ffmpeg -i video.mpgimage%d.jpg" command in the FFmpeg software, thereby obtaining the original image frames in the first video.
在步骤S1200中,在原始图像帧中确定出第一区域,其中,原始图像帧包括第一区域和第二区域,原始图像帧中的第一区域处于欠曝状态,原始图像帧中的第二区域未处于欠曝状态。In step S1200, a first area is determined in the original image frame, wherein the original image frame includes a first area and a second area, the first area in the original image frame is in an underexposed state, and the second area in the original image frame is not in an underexposed state.
通常来说,由于拍摄技术、环境等因素的影响,拍摄得到的照片会出现欠曝或者过曝等非正常曝光的情况。其中,欠曝是指曝光不足,表现为图像中较暗区域的细节缺失,过曝是指曝光过度,表现为图像中较亮区域的细节缺失。老电影、老电视剧等类型的视频通常存在欠曝问题。Generally speaking, due to the influence of shooting techniques, environment and other factors, the photos taken will be underexposed or overexposed. Underexposure refers to insufficient exposure, which is manifested as a lack of details in the darker areas of the image, and overexposure refers to overexposure, which is manifested as a lack of details in the brighter areas of the image. Old movies, old TV series and other types of videos often have underexposure problems.
本实施例中,可以先将原始图像帧划分为多个子区域,再判断每一子区域的曝光状态,确定出处于欠曝状态的区域,即第一区域。In this embodiment, the original image frame may be first divided into a plurality of sub-regions, and then the exposure state of each sub-region may be determined to determine the region in the underexposed state, that is, the first region.
在划分子区域时,可以将原始图像帧均匀划分为多个网格,网格形状例如是正方形、正六边形等,将每个网格作为一个子区域。When dividing the sub-regions, the original image frame may be evenly divided into a plurality of grids, the grid shape being, for example, a square, a regular hexagon, etc., and each grid is regarded as a sub-region.
在划分子区域时,还可以先确定出原始图像帧中的图像轮廓,将每个图像轮廓内的区域作为一个子区域。When dividing the sub-regions, the image contour in the original image frame may be determined first, and the area within each image contour is taken as a sub-region.
在判断曝光状态时,可以结合拍摄环境、根据子区域内像素的平均值进行判断。例如,对于白天拍摄的图像,如果子区域内像素的平均值超过120并且不超过150,则判断子区域处于曝光正常状态,如果子区域内像素的平均值不超过120,则判断子区域处于欠曝状态,如果子区域内像素的平均值超过150,则判断子区域处于过曝状态。When judging the exposure state, the shooting environment and the average value of the pixels in the sub-region may be combined to make a judgment. For example, for an image shot during the day, if the average value of the pixels in the sub-region exceeds 120 and does not exceed 150, the sub-region is judged to be in a normal exposure state, if the average value of the pixels in the sub-region does not exceed 120, the sub-region is judged to be in an under-exposed state, and if the average value of the pixels in the sub-region exceeds 150, the sub-region is judged to be in an over-exposed state.
在判断曝光状态时,还可以根据子区域的亮度分布进行判断。例如,如果子区域的亮度直方图的峰值集中的右侧,则判断子区域处于过曝状态,如果子区域的亮度直方图的峰值集中在左侧,则判断子区域处于欠曝状态,如果子区域的亮度直方图的峰值分布均匀,则判断子区域处于曝光正常状态。When judging the exposure state, judgment can also be made based on the brightness distribution of the sub-region. For example, if the peak value of the brightness histogram of the sub-region is concentrated on the right side, the sub-region is judged to be in an overexposed state, if the peak value of the brightness histogram of the sub-region is concentrated on the left side, the sub-region is judged to be in an underexposed state, and if the peak value of the brightness histogram of the sub-region is evenly distributed, the sub-region is judged to be in a normal exposure state.
在步骤S1300中,对原始图像帧进行增强处理,得到目标图像帧,其中,增强处理用于将图像中不同区域的曝光状态调整至曝光正常状态,目标图像帧中的第一区域和第二区域均处于曝光正常状态。In step S1300, the original image frame is enhanced to obtain a target image frame, wherein the enhancement processing is used to adjust the exposure status of different areas in the image to a normal exposure state, and the first area and the second area in the target image frame are both in a normal exposure state.
本实施例中,对原始图像帧进行增强处理,该增强处理可以将图像中国不同区域的曝光状态调整至曝光正常状态。目标图像帧中的第一区域与原始图像帧中的第一区域相对应,目标图像帧中的第二区域与原始图像帧中的第二区域相对应。In this embodiment, the original image frame is enhanced, and the enhancement process can adjust the exposure state of different areas of the image to a normal exposure state. The first area in the target image frame corresponds to the first area in the original image frame, and the second area in the target image frame corresponds to the second area in the original image frame.
在一个实施例中,步骤S1300进一步包括:通过对原始图像帧进行对比度增强处理,得到辅助图像帧,其中,辅助图像帧中的第一区域处于曝光正常状态,辅助图形帧中的第二区域处于过曝状态;对原始图像帧和辅助图像帧进行图像融合,得到目标图像帧。In one embodiment, step S1300 further includes: performing contrast enhancement processing on the original image frame to obtain an auxiliary image frame, wherein the first area in the auxiliary image frame is in a normal exposure state and the second area in the auxiliary image frame is in an overexposed state; performing image fusion on the original image frame and the auxiliary image frame to obtain a target image frame.
比度增强处理的现有技术中常用的处理方法,这种方式在将原本处于欠曝状态的区域调整为曝光正常状态的同时,往往会将原本处于曝光正常状态的区域调整为过曝状态。Contrast enhancement is a commonly used processing method in the prior art. This method adjusts the area that was originally in an underexposed state to a normal exposed state, while often adjusting the area that was originally in a normal exposed state to an overexposed state.
本实施例中,通过对原始图像帧进行对比度增强处理,得到辅助图像帧。其中,对比度增强处理可以采用直方图均衡化、灰度变换等具体方法。In this embodiment, the auxiliary image frame is obtained by performing contrast enhancement processing on the original image frame, wherein the contrast enhancement processing may adopt specific methods such as histogram equalization and grayscale conversion.
本实施例中,通过对原始图像帧和辅助图像帧进行图像融合,得到目标图像帧。其中,图像融合是指综合两个图像的信息得到目标图像的过程。In this embodiment, the target image frame is obtained by performing image fusion on the original image frame and the auxiliary image frame, wherein image fusion refers to the process of obtaining the target image by integrating information of two images.
在一个实施例中,图像融合的过程包括:获取原始图像帧的光照权重信息,其中,光照权重信息用于指示原始图像帧中的每个像素点对应的光照权重,光照权重与对应像素点的亮度相关;根据光照权重信息对原始图像帧和辅助图像帧进行图像融合,得到目标图像帧。In one embodiment, the image fusion process includes: obtaining illumination weight information of the original image frame, wherein the illumination weight information is used to indicate the illumination weight corresponding to each pixel in the original image frame, and the illumination weight is related to the brightness of the corresponding pixel; performing image fusion on the original image frame and the auxiliary image frame according to the illumination weight information to obtain a target image frame.
上述光照权重信息能够表征原始图像帧的明暗强度,光照权重与对应像素点的亮度可以成正相关或负相关。可选地,光照权重信息可以用权重图像来表征,权重图像的大小与原始图像的大小一致;以光照权重与对应像素点的亮度成正相关为例,权重图像中与原始图像帧中较暗区域(第一区域)对应的光照权重较小,而与原始图像帧中较亮区域(第二区域)对应的光照权重则较大。The above-mentioned illumination weight information can characterize the brightness and darkness intensity of the original image frame, and the illumination weight can be positively correlated or negatively correlated with the brightness of the corresponding pixel. Optionally, the illumination weight information can be characterized by a weight image, and the size of the weight image is consistent with the size of the original image; taking the illumination weight as an example of being positively correlated with the brightness of the corresponding pixel, the illumination weight corresponding to the darker area (first area) in the original image frame in the weight image is smaller, while the illumination weight corresponding to the brighter area (second area) in the original image frame is larger.
可选地,上述原始图像帧和权重图像均可以表示为图像矩阵(二维矩阵)的形式,图像矩阵的行对应图像的高(单位为像素),图像矩阵的列对应图像的宽(单位为像素),原始图像帧的图像矩阵中的元素对应原始图像帧的像素点的像素值,权重图像的图像矩阵中的元素(光照权重)与原始图像帧中像素点的亮度有关。原始图像帧的图像矩阵与权重图像的图像矩阵在行数和列数上均是相同的,二者在同一位置下的两个元素对应原始图像中的同一个像素点。Optionally, the above-mentioned original image frame and weight image can be expressed in the form of an image matrix (two-dimensional matrix), the rows of the image matrix correspond to the height of the image (in pixels), the columns of the image matrix correspond to the width of the image (in pixels), the elements in the image matrix of the original image frame correspond to the pixel values of the pixels of the original image frame, and the elements in the image matrix of the weight image (lighting weights) are related to the brightness of the pixels in the original image frame. The image matrix of the original image frame and the image matrix of the weight image are the same in terms of the number of rows and columns, and the two elements at the same position of the two correspond to the same pixel in the original image.
在对原始图像帧和辅助图像帧进行图像融合时,可以基于光照权重信息分别为原始图像帧和辅助图像帧分配不同的融合权重,使得对于光照较弱的区域(第一区域),原始图像帧的融合权重较小,辅助图像帧的融合权重较大;而对于光照较强的区域(第二区域),原始图像帧的融合权重较大,辅助图像帧的融合权重较小。这样能够保证原始图像中曝光正常区域或过曝区域的部分图像亮度保持不变,而较暗区域的部分图像得到增强,也即保证原始图像中较暗区域(第一区域)的增强,较亮区域(第二区域)在图像增强后不过度曝光,图像色彩不失真,从而有效改善了现有技术中存在的图像中较暗区域的增强效果不足,较亮区域又容易过度增强,导致颜色失真的问题。When the original image frame and the auxiliary image frame are subjected to image fusion, different fusion weights can be assigned to the original image frame and the auxiliary image frame based on the illumination weight information, so that for the area with weak illumination (the first area), the fusion weight of the original image frame is smaller, and the fusion weight of the auxiliary image frame is larger; while for the area with strong illumination (the second area), the fusion weight of the original image frame is larger, and the fusion weight of the auxiliary image frame is smaller. In this way, it can be ensured that the brightness of part of the image in the normal exposure area or overexposed area in the original image remains unchanged, while part of the image in the darker area is enhanced, that is, the darker area (the first area) in the original image is enhanced, and the brighter area (the second area) is not overexposed after image enhancement, and the image color is not distorted, thereby effectively improving the problem that the enhancement effect of the darker area in the image is insufficient, and the brighter area is easily over-enhanced, resulting in color distortion in the prior art.
在一个例子中,可以逐像素对辅助图像帧和原始图像帧进行融合。例如,对于原始图像帧中的像素A1(该像素的像素值记为a1)和辅助图像帧中的像素A2(该像素的像素值记为a2),假设像素A1的光照权重为p,像素A1和像素A2融合得到像素A3,则像素A3的像素值a3=a1*p+a2*(1-p)。In one example, the auxiliary image frame and the original image frame may be fused pixel by pixel. For example, for pixel A1 in the original image frame (the pixel value of the pixel is recorded as a1) and pixel A2 in the auxiliary image frame (the pixel value of the pixel is recorded as a2), assuming that the illumination weight of pixel A1 is p, pixel A1 and pixel A2 are fused to obtain pixel A3, then the pixel value of pixel A3 is a3=a1*p+a2*(1-p).
本实施例中,光照权重与对应像素点的亮度相关,例如,亮度较大的像素点对应的光照权重也较大。在一个例子中,原始图像帧中第一区域内像素的光照权重为0,第二区域内像素的光照权重为1。在另外一个例子中,原始图像帧中第一区域内像素的光照权重为0.2,第二区域内像素的光照权重为0.7。In this embodiment, the illumination weight is related to the brightness of the corresponding pixel point. For example, the illumination weight corresponding to the pixel point with greater brightness is also greater. In one example, the illumination weight of the pixels in the first area of the original image frame is 0, and the illumination weight of the pixels in the second area is 1. In another example, the illumination weight of the pixels in the first area of the original image frame is 0.2, and the illumination weight of the pixels in the second area is 0.7.
容易理解,本实施例中的光照权重使得在融合过程中,原始图像帧中第一区域对目标图像帧的贡献较小,原始图像帧中第二区域对目标图像帧的贡献较大。因此,目标图像帧在提高了原始图像帧中第一区域亮度的同时,还能够有效保留原始图像帧中第二区域的亮度信息,防止出现过曝现象。It is easy to understand that the illumination weight in this embodiment makes the first area in the original image frame contribute less to the target image frame, while the second area in the original image frame contributes more to the target image frame during the fusion process. Therefore, while the target image frame increases the brightness of the first area in the original image frame, it can also effectively retain the brightness information of the second area in the original image frame to prevent overexposure.
在步骤S1400中,根据目标图像帧生成第二视频。In step S1400 , a second video is generated according to the target image frame.
本实施例中,将目标图像帧按顺序拼接为视频,即获得了处理后的视频即第二视频。In this embodiment, the target image frames are spliced into a video in sequence, that is, a processed video, ie, a second video, is obtained.
本实施例中的视频处理方法,通过对原始图像帧进行增强处理,将原始图像帧中的欠曝区域调整为曝光正常状态的同时,还防止原始图像帧中曝光正常状态的区域出现过曝,有利于提升视频的图像质量。The video processing method in this embodiment enhances the original image frame to adjust the underexposed area in the original image frame to a normally exposed state, while preventing the area in the normally exposed state in the original image frame from being overexposed, which is beneficial to improving the image quality of the video.
在一个实施例中,在通过对原始图像帧进行对比度增强处理,得到辅助图像帧之前,上述视频处理方法还包括:对原始图像帧进行去噪处理,得到更新后的原始图像帧,其中,去噪处理用于降低图像的噪声;基于更新后的原始图像帧,执行通过对原始图像帧进行对比度增强处理,得到辅助图像帧的步骤。In one embodiment, before obtaining the auxiliary image frame by performing contrast enhancement processing on the original image frame, the above-mentioned video processing method also includes: performing denoising processing on the original image frame to obtain an updated original image frame, wherein the denoising processing is used to reduce the noise of the image; based on the updated original image frame, executing the step of obtaining the auxiliary image frame by performing contrast enhancement processing on the original image frame.
图像噪声是指存在于图像数据中的不必要的或多余的干扰信息。图像噪声产生的原因通常涉及多个方面。例如,在图像采集阶段,由于光电自身特性、设备机械运动、器材材料、设备电路等内部原因,以及电磁波干扰等外部原因,都会引起图像噪声。图像采集完成后,在图像数据的传输、解压等环节还会带来新的噪声。图像噪声会影响老旧影片的画面质量。Image noise refers to unnecessary or redundant interference information in image data. The causes of image noise usually involve multiple aspects. For example, during the image acquisition stage, image noise can be caused by internal reasons such as the photoelectric characteristics, mechanical movement of the equipment, equipment materials, and equipment circuits, as well as external reasons such as electromagnetic interference. After the image is acquired, new noise will be introduced in the transmission and decompression of the image data. Image noise will affect the picture quality of old movies.
本实施例中,针对原始图像帧中的噪声进行去噪处理。可以采用均值滤波器、自适应维纳滤波器、中值滤波器、形态学噪声滤除器、小波去噪等手段去除图像中的噪声。In this embodiment, denoising is performed on the noise in the original image frame, and the noise in the image can be removed by using a mean filter, an adaptive Wiener filter, a median filter, a morphological noise filter, a wavelet denoising, or the like.
在一个实施例中,对原始图像帧进行减少图像噪声的去噪处理,包括:通过预先训练的去噪模型,对原始图像帧进行减少图像噪声的去噪处理。In one embodiment, performing denoising processing to reduce image noise on the original image frame includes: performing denoising processing to reduce image noise on the original image frame using a pre-trained denoising model.
本实施例中,基于神经网络模型,对图像帧中由采集噪声、压缩噪声等形成的混合噪声进行去噪处理。In this embodiment, based on the neural network model, denoising is performed on the mixed noise formed by acquisition noise, compression noise, etc. in the image frame.
在一个实施例中,在进行去噪处理之前,先生成去噪模型。生成去噪模型的过程包括:在原始图像中加入随机强度的噪声,获得噪声图像;根据原始图像和噪声图像对卷积神经网络模型进行训练,获得去噪模型。In one embodiment, before performing denoising, a denoising model is generated. The process of generating the denoising model includes: adding noise of random intensity to the original image to obtain a noise image; training a convolutional neural network model according to the original image and the noise image to obtain the denoising model.
本实施例中,原始图像是画面质量较高的图片。在原始图像中加入的随机噪声例如是高斯噪声、椒盐噪声等。In this embodiment, the original image is a picture with high picture quality. The random noise added to the original image is, for example, Gaussian noise, salt and pepper noise, etc.
本实施例中,采用卷积神经网络的形式生成去噪模型。卷积神经网络(Convolutional Neural Networks,CNN)是一类包含卷积计算且具有深度结构的前馈神经网络,是深度学习(deep learning)的代表算法之一。In this embodiment, a denoising model is generated in the form of a convolutional neural network. Convolutional neural networks (CNN) are a type of feedforward neural network that includes convolution calculations and has a deep structure, and is one of the representative algorithms of deep learning.
本实施例中,根据原始图像和噪声图像形成训练数据集,对卷积神经网络进行训练,其中,噪声图像作为卷积神经网络的输入,原始图像作为神经网络的输出。训练好的卷积神经网络模型即为去噪模型。In this embodiment, a training data set is formed based on the original image and the noisy image to train the convolutional neural network, wherein the noisy image is used as the input of the convolutional neural network and the original image is used as the output of the neural network. The trained convolutional neural network model is the denoising model.
在一个实施例中,在通过对原始图像帧进行对比度增强处理,得到辅助图像帧之前,上述视频处理方法还包括:对原始图像帧进行边缘增强处理,得到更新后的原始图像帧,其中,边缘增强处理用于提升图像中轮廓边缘的清晰度;基于更新后的原始图像帧,执行通过对原始图像帧进行对比度增强处理,得到辅助图像帧的步骤。In one embodiment, before obtaining the auxiliary image frame by performing contrast enhancement processing on the original image frame, the above-mentioned video processing method also includes: performing edge enhancement processing on the original image frame to obtain an updated original image frame, wherein the edge enhancement processing is used to improve the clarity of the contour edge in the image; based on the updated original image frame, executing the step of obtaining the auxiliary image frame by performing contrast enhancement processing on the original image frame.
早期视频中,不同区域的边缘界限较为模糊。本实施例中对图像帧进行边缘增强处理,有利于提高视频的清晰度。In early videos, the edge boundaries of different areas are relatively fuzzy. In this embodiment, edge enhancement processing is performed on the image frame, which is beneficial to improving the clarity of the video.
本实施例中,可以通高通滤波、空域微分等方法进行边缘增强处理。在一个例子中,采用空域微分法进行边缘增强处理,通过梯度模算子计算梯度值,由于边缘处灰度的变化较大,对应的梯度值也较大,因此加强梯度值大的像素灰度值就可以突出边缘处细节,从而达到边缘增强的目的。In this embodiment, edge enhancement processing can be performed by high-pass filtering, spatial domain differentiation, etc. In one example, spatial domain differentiation method is used for edge enhancement processing, and the gradient value is calculated by the gradient modulus operator. Since the grayscale change at the edge is large, the corresponding gradient value is also large, so strengthening the grayscale value of pixels with large gradient values can highlight the details at the edge, thereby achieving the purpose of edge enhancement.
在一个实施例中,在对原始图像帧和辅助图像帧进行融合,得到目标图像帧之后,上述视频处理方法还包括:对目标图像帧进行超分辨率处理,其中,超分辨率处理用于提高图像的分辨率。In one embodiment, after the original image frame and the auxiliary image frame are fused to obtain the target image frame, the video processing method further includes: performing super-resolution processing on the target image frame, wherein the super-resolution processing is used to improve the resolution of the image.
受硬件条件的限制,早期视频的分辨率大小有限。本实施例中对图像帧进行超分辨率处理,获得分辨率更高的图像,有利于适应现在的显示设备。Due to the limitation of hardware conditions, the resolution of early videos is limited. In this embodiment, super-resolution processing is performed on the image frame to obtain an image with higher resolution, which is conducive to adapting to current display devices.
本实施例中,可以基于稀疏编码方法、自模范方法、贝叶斯方法、金字塔算法、深度学习方法等,对图像帧进行超分辨率处理。In this embodiment, super-resolution processing can be performed on the image frame based on a sparse coding method, a self-model method, a Bayesian method, a pyramid algorithm, a deep learning method, etc.
在本发明的一个实施例中,超分辨率处理包括:通过预先训练的超分辨率模型,对暗场增强处理后的目标图像帧进行提高图像分辨率的超分辨率处理。In one embodiment of the present invention, the super-resolution processing includes: performing super-resolution processing to improve the image resolution of the target image frame after the dark field enhancement processing by using a pre-trained super-resolution model.
本实施例中,基于神经网络模型对目标图像帧进行超分辨率处理。In this embodiment, super-resolution processing is performed on the target image frame based on a neural network model.
在一个实施例中,在进行超分辨率处理之前,先生成超分辨率模型。生成超分辨率模型的过程包括:对样本图像进行压缩,获得低分辨率图像;根据样本图像和低分辨率图像对卷积神经网络模型进行训练,获得超分辨率模型。In one embodiment, before performing super-resolution processing, a super-resolution model is generated. The process of generating the super-resolution model includes: compressing the sample image to obtain a low-resolution image; training a convolutional neural network model according to the sample image and the low-resolution image to obtain the super-resolution model.
本实施例中,选择高分辨率图片作为样本图像。In this embodiment, a high-resolution picture is selected as the sample image.
本实施例中,通过对样本图像进行质量压缩,获得低分辨率图像。In this embodiment, a low-resolution image is obtained by performing quality compression on the sample image.
本实施例中,根据样本图像和低分辨率图像形成训练数据集,对卷积神经网络进行训练,其中,低分辨率图像作为卷积神经网络的输入,样本图像作为神经网络的输出。训练好的卷积神经网络模型即为超分辨率模型。In this embodiment, a training data set is formed based on sample images and low-resolution images to train the convolutional neural network, wherein the low-resolution image is used as the input of the convolutional neural network and the sample image is used as the output of the neural network. The trained convolutional neural network model is the super-resolution model.
在一个实施例中,在根据目标图像帧,生成第二视频之后,还包括:对第二视频进行超帧率处理,得到用于播放的第三视频,其中,超帧率处理用于提高视频的帧率。In one embodiment, after generating the second video according to the target image frame, it also includes: performing super frame rate processing on the second video to obtain a third video for playback, wherein the super frame rate processing is used to increase the frame rate of the video.
早期影片的帧率通常较低,这会对视频播放的流畅度造成影响。本实施例中对视频进行超帧率处理,使视频播放更加流畅。The frame rate of early movies is usually low, which will affect the smoothness of video playback. In this embodiment, super frame rate processing is performed on the video to make the video playback smoother.
本实施例中,可以采用简单的帧率提升算法、含有运动补偿的帧率提升算法、基于自回归模型的帧率提升算法等方法进行超帧率处理。In this embodiment, a simple frame rate enhancement algorithm, a frame rate enhancement algorithm including motion compensation, a frame rate enhancement algorithm based on an autoregressive model, or the like may be used to perform super frame rate processing.
在一个例子中,采用简单帧率提升算法中的帧平均方法进行超帧率处理,即,将第二视频的相邻两帧的加权平均结果作为插值帧并增加到两帧之间,将第二视频的原有帧和插值处理得到的插值帧按顺序拼接,从而得到第三视频。In one example, a frame averaging method in a simple frame rate enhancement algorithm is used for super frame rate processing, that is, a weighted average result of two adjacent frames of the second video is used as an interpolation frame and added between the two frames, and the original frames of the second video and the interpolation frames obtained by the interpolation processing are spliced in sequence to obtain a third video.
图3示出了本实施例中视频处理方法实施的具体例子。参见图3,电子设备首先利用FFmpeg视频处理工具将视频切割为多个图像帧,即执行步骤S101。对于每个图像帧,电子设备将该图像帧输入预先训练的卷积神经网络模型,获得去噪后的图像帧,即执行步骤S102。对于去噪后的每个图像帧,电子设备采用基于滤波或者矩阵的边缘锐化方法,对该图像帧进行边缘锐化处理,即执行步骤S103。对于边缘增强后的每个图像帧,电子设备通过现有的图像增强方法构建辅助图像,并将图像帧和辅助图形按照特定权重进行融合,提高图像帧中弱亮度区域的图像质量,保持图像帧中强亮度区域的亮度不变,即执行步骤S105。对于暗场增强处理后的每个图像帧,电子设备将该图像帧输入预先训练的卷积神经网络,获得分辨率更高的图像帧,即执行步骤S106。对于超分辨率处理后的多个图像帧,电子设备基于自回归模型的帧率提升算法在其中插入新的图像帧,即执行步骤S107。对于插帧处理后的多个图像帧,电子设备将这些图像帧按顺序拼接为视频,从而获得处理后的视频,即执行步骤S108。FIG3 shows a specific example of the implementation of the video processing method in this embodiment. Referring to FIG3, the electronic device first uses the FFmpeg video processing tool to cut the video into multiple image frames, that is, execute step S101. For each image frame, the electronic device inputs the image frame into a pre-trained convolutional neural network model to obtain a denoised image frame, that is, execute step S102. For each denoised image frame, the electronic device uses a filtering or matrix-based edge sharpening method to perform edge sharpening processing on the image frame, that is, execute step S103. For each image frame after edge enhancement, the electronic device constructs an auxiliary image through an existing image enhancement method, and fuses the image frame and the auxiliary graphic according to a specific weight to improve the image quality of the weak brightness area in the image frame and keep the brightness of the strong brightness area in the image frame unchanged, that is, execute step S105. For each image frame after dark field enhancement processing, the electronic device inputs the image frame into a pre-trained convolutional neural network to obtain an image frame with higher resolution, that is, execute step S106. For multiple image frames after super-resolution processing, the electronic device inserts a new image frame into it based on the frame rate improvement algorithm of the autoregressive model, that is, execute step S107. For the multiple image frames after the interpolation process, the electronic device stitches the image frames into a video in sequence, thereby obtaining a processed video, that is, executing step S108.
<装置实施例><Device Example>
本实施例提供一种视频处理装置,包括图像提取模块、图像分析模块、增强处理模块和视频生成模块。This embodiment provides a video processing device, including an image extraction module, an image analysis module, an enhancement processing module and a video generation module.
图像提取模块,用于获取第一视频中的原始图像帧。The image extraction module is used to obtain the original image frame in the first video.
图像分析模块,用于在原始图像帧中确定出第一区域,其中,原始图像帧包括第一区域和第二区域,原始图像帧中的第一区域处于欠曝状态,原始图像帧中的第二区域未处于欠曝状态。The image analysis module is used to determine a first area in an original image frame, wherein the original image frame includes a first area and a second area, the first area in the original image frame is in an underexposed state, and the second area in the original image frame is not in an underexposed state.
增强处理模块,用于对原始图像帧进行增强处理,得到目标图像帧,其中,增强处理用于将图像中不同区域的曝光状态调整至曝光正常状态,目标图像帧中的第一区域和第二区域均处于曝光正常状态。The enhancement processing module is used to perform enhancement processing on the original image frame to obtain a target image frame, wherein the enhancement processing is used to adjust the exposure status of different areas in the image to a normal exposure state, and the first area and the second area in the target image frame are both in a normal exposure state.
视频生成模块,用于根据目标图像帧,生成第二视频。The video generation module is used to generate a second video according to the target image frame.
在一个实施例中,增强处理模块在对原始图像帧进行增强处理,得到目标图像帧时,用于:通过对原始图像帧进行对比度增强处理,得到辅助图像帧,其中,辅助图像帧中的第一区域处于曝光正常状态,辅助图形帧中的第二区域处于过曝状态;对原始图像帧和辅助图像帧进行图像融合,得到目标图像帧。In one embodiment, when the enhancement processing module performs enhancement processing on the original image frame to obtain the target image frame, it is used to: obtain an auxiliary image frame by performing contrast enhancement processing on the original image frame, wherein the first area in the auxiliary image frame is in a normal exposure state and the second area in the auxiliary image frame is in an overexposed state; and perform image fusion on the original image frame and the auxiliary image frame to obtain the target image frame.
在一个实施例中,增强处理模块在对原始图像帧和辅助图像帧进行融合,得到目标图像帧时,用于:获取原始图像的光照权重信息,其中,光照权重信息用于指示原始图像中的每个像素点对应的光照权重,光照权重与对应像素点的亮度相关;根据光照权重信息对原始图像和辅助图像帧进行图像融合,得到目标图像帧。In one embodiment, when the enhancement processing module fuses the original image frame and the auxiliary image frame to obtain the target image frame, it is used to: obtain the illumination weight information of the original image, wherein the illumination weight information is used to indicate the illumination weight corresponding to each pixel in the original image, and the illumination weight is related to the brightness of the corresponding pixel; perform image fusion on the original image and the auxiliary image frame according to the illumination weight information to obtain the target image frame.
在一个实施例中,视频处理装置还包括去噪处理模块,该去噪处理模块用于:在通过对原始图像帧进行对比度增强处理,得到辅助图像帧之前,对原始图像帧进行去噪处理,得到更新后的原始图像帧,其中,去噪处理用于降低图像的噪声。增强处理模块基于更新后的原始图像帧,执行通过对原始图像帧进行对比度增强处理,得到辅助图像帧的步骤。In one embodiment, the video processing device further includes a denoising processing module, which is used to: before performing contrast enhancement processing on the original image frame to obtain the auxiliary image frame, perform denoising processing on the original image frame to obtain an updated original image frame, wherein the denoising processing is used to reduce image noise. The enhancement processing module performs the step of performing contrast enhancement processing on the original image frame to obtain the auxiliary image frame based on the updated original image frame.
在一个实施例中,视频处理装置还包括边缘增强处理模块,该边缘增强处理模块用于:在通过对原始图像帧进行对比度增强处理,得到辅助图像帧之前,对原始图像帧进行边缘增强处理,得到更新后的原始图像帧,其中,边缘增强处理用于提升图像中轮廓边缘的清晰度。增强处理模块基于更新后的原始图像帧,执行通过对原始图像帧进行对比度增强处理,得到辅助图像帧的步骤。In one embodiment, the video processing device further includes an edge enhancement processing module, which is used to: before performing contrast enhancement processing on the original image frame to obtain the auxiliary image frame, perform edge enhancement processing on the original image frame to obtain an updated original image frame, wherein the edge enhancement processing is used to improve the clarity of the contour edge in the image. Based on the updated original image frame, the enhancement processing module performs the step of performing contrast enhancement processing on the original image frame to obtain the auxiliary image frame.
在一个实施例中,视频处理装置还包括超分辨率模块,该超分辨率模块用于:在对原始图像帧和辅助图像帧进行融合,得到目标图像帧之后,对目标图像帧进行超分辨率处理,其中,超分辨率处理用于提高图像的分辨率。In one embodiment, the video processing device further includes a super-resolution module, which is used to: after fusing the original image frame and the auxiliary image frame to obtain the target image frame, perform super-resolution processing on the target image frame, wherein the super-resolution processing is used to improve the resolution of the image.
在一个实施例中,视频处理装置还包括超帧率模块,该超帧率模块用于:在根据目标图像帧,生成第二视频之后,对第二视频进行超帧率处理,得到用于播放的第三视频,其中,超帧率处理用于提高视频的帧率。In one embodiment, the video processing device also includes a super frame rate module, which is used to: after generating a second video based on a target image frame, perform super frame rate processing on the second video to obtain a third video for playback, wherein the super frame rate processing is used to increase the frame rate of the video.
<电子设备实施例><Electronic Equipment Embodiment>
本实施例提供一种电子设备,该电子设备包括存储器和处理器。This embodiment provides an electronic device, which includes a memory and a processor.
存储器用于存储可执行命令。The memory is used to store executable commands.
处理器用于在可执行命令的控制下,执行本发明方法实施例描述的方法。The processor is used to execute the method described in the method embodiment of the present invention under the control of the executable instructions.
<计算机可读存储介质实施例><Computer Readable Storage Medium Embodiment>
本实施例提供一种计算机可读存储介质,该介质存储有可执行命令,该可执行命令被处理器执行时,执行如本发明方法实施例描述的方法。This embodiment provides a computer-readable storage medium, which stores executable commands. When the executable commands are executed by a processor, the method described in the method embodiment of the present invention is executed.
本发明可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本发明的各个方面的计算机可读程序指令。The present invention may be a system, a method and/or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: 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), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing/processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers. The network adapter card or network interface in each computing/processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device.
用于执行本发明操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本发明的各个方面。The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, 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., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
这里参照根据本发明实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本发明的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Various aspects of the present invention are described herein with reference to the flow charts and/or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and/or block diagram and the combination of each box in the flow chart and/or block diagram can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions/actions specified in one or more boxes in the flowchart and/or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and/or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions/actions specified in one or more boxes in the flowchart and/or block diagram.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions/actions specified in one or more boxes in the flowchart and/or block diagram.
附图中的流程图和框图显示了根据本发明的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。对于本领域技术人员来说公知的是,通过硬件方式实现、通过软件方式实现以及通过软件和硬件结合的方式实现都是等价的。The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and a part of a module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes 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 box in the block diagram and/or the flowchart, and the combination of the boxes in the block diagram and/or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。本发明的范围由所附权利要求来限定。Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.
Claims (8)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911118706.7A CN112819699B (en) | 2019-11-15 | 2019-11-15 | Video processing method, device and electronic equipment |
| PCT/CN2020/127717 WO2021093718A1 (en) | 2019-11-15 | 2020-11-10 | Video processing method, video repair method, apparatus and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911118706.7A CN112819699B (en) | 2019-11-15 | 2019-11-15 | Video processing method, device and electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN112819699A CN112819699A (en) | 2021-05-18 |
| CN112819699B true CN112819699B (en) | 2024-11-05 |
Family
ID=75851603
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911118706.7A Active CN112819699B (en) | 2019-11-15 | 2019-11-15 | Video processing method, device and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN112819699B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US12058348B2 (en) * | 2020-04-17 | 2024-08-06 | Qualcomm Incorporated | Parallelized rate-distortion optimized quantization using deep learning |
| CN113569630B (en) * | 2021-06-16 | 2024-07-19 | 东风汽车集团股份有限公司 | Electronic rearview mirror image processing method and device |
| CN116095509B (en) * | 2021-11-05 | 2024-04-12 | 荣耀终端有限公司 | Method, device, electronic device and storage medium for generating video frames |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110087003A (en) * | 2019-04-30 | 2019-08-02 | 深圳市华星光电技术有限公司 | More exposure image fusion methods |
| CN110149550A (en) * | 2018-06-19 | 2019-08-20 | 腾讯科技(深圳)有限公司 | A kind of image processing method and device |
Family Cites Families (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103973958B (en) * | 2013-01-30 | 2018-04-03 | 阿里巴巴集团控股有限公司 | Image processing method and equipment |
| CN103530848A (en) * | 2013-09-27 | 2014-01-22 | 中国人民解放军空军工程大学 | Double exposure implementation method for inhomogeneous illumination image |
| CN106169182B (en) * | 2016-05-25 | 2019-08-09 | 西安邮电大学 | A method for synthesizing multiple images with different exposures |
| CN108205796B (en) * | 2016-12-16 | 2021-08-10 | 大唐电信科技股份有限公司 | Multi-exposure image fusion method and device |
| CN110651297B (en) * | 2017-05-16 | 2022-11-11 | 苹果公司 | Optional enhancement of synthesized long exposure images using a guide image |
| CN107492075B (en) * | 2017-07-28 | 2019-12-10 | 浙江大学 | A method for exposure correction of single LDR image based on detail enhancement |
| CN107465882B (en) * | 2017-09-22 | 2019-11-05 | 维沃移动通信有限公司 | A kind of image capturing method and mobile terminal |
| WO2019071613A1 (en) * | 2017-10-13 | 2019-04-18 | 华为技术有限公司 | Image processing method and device |
| CN107800971B (en) * | 2017-10-27 | 2019-08-20 | Oppo广东移动通信有限公司 | Automatic exposure control processing method, device and equipment for panoramic shooting |
| CN110248105B (en) * | 2018-12-10 | 2020-12-08 | 浙江大华技术股份有限公司 | Image processing method, camera and computer storage medium |
| CN109729279B (en) * | 2018-12-20 | 2020-11-17 | 华为技术有限公司 | Image shooting method and terminal equipment |
| CN110248107A (en) * | 2019-06-13 | 2019-09-17 | Oppo广东移动通信有限公司 | Image processing method and device |
-
2019
- 2019-11-15 CN CN201911118706.7A patent/CN112819699B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110149550A (en) * | 2018-06-19 | 2019-08-20 | 腾讯科技(深圳)有限公司 | A kind of image processing method and device |
| CN110087003A (en) * | 2019-04-30 | 2019-08-02 | 深圳市华星光电技术有限公司 | More exposure image fusion methods |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112819699A (en) | 2021-05-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11182877B2 (en) | Techniques for controlled generation of training data for machine learning enabled image enhancement | |
| Zhou et al. | Lednet: Joint low-light enhancement and deblurring in the dark | |
| WO2021093718A1 (en) | Video processing method, video repair method, apparatus and device | |
| Chang et al. | Low-light image restoration with short-and long-exposure raw pairs | |
| Rao et al. | A Survey of Video Enhancement Techniques. | |
| CN108702496B (en) | System and method for real-time tone mapping | |
| CN113170030A (en) | Correction of photographic underexposure using neural networks | |
| CN117916765A (en) | System and method for non-linear image intensity transformation for denoising and low precision image processing | |
| CN112153240B (en) | Method and device for adjusting image quality and readable storage medium | |
| CN112819699B (en) | Video processing method, device and electronic equipment | |
| JP2024545997A (en) | High dynamic range viewpoint synthesis from noisy raw images | |
| Gryaditskaya et al. | Motion aware exposure bracketing for HDR video | |
| KR20190090288A (en) | Electronic apparatus and controlling method of thereof | |
| CN111696034B (en) | Image processing methods, devices and electronic equipment | |
| Bao et al. | Temporal-mapping photography for event cameras | |
| Rao et al. | Illumination-based nighttime video contrast enhancement using genetic algorithm | |
| CN114283101B (en) | Multi-exposure image fusion unsupervised learning method and device and electronic equipment | |
| JP7715937B2 (en) | Cascaded multiresolution machine learning for computationally efficient image processing | |
| CN113724144B (en) | Image processing method and image signal processor on terminal equipment | |
| CN113538265A (en) | Image denoising method and device, computer readable medium and electronic device | |
| Alpay et al. | DeepDuoHDR: A Low Complexity Two Exposure Algorithm for HDR Deghosting on Mobile Devices | |
| Huang et al. | A two-stage HDR reconstruction pipeline for extreme dark-light RGGB images | |
| Zhang et al. | A dynamic range adjustable inverse tone mapping operator based on human visual system | |
| WO2023044653A1 (en) | Display device system, and method for adaptively enhancing image quality | |
| US20250384527A1 (en) | Local tone mapping using a neural-network-generated luminance compensation gain map |
Legal Events
| 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |