WO2023077938A1 - Video frame generation method and apparatus, electronic device, and storage medium - Google Patents

Video frame generation method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023077938A1
WO2023077938A1 PCT/CN2022/116757 CN2022116757W WO2023077938A1 WO 2023077938 A1 WO2023077938 A1 WO 2023077938A1 CN 2022116757 W CN2022116757 W CN 2022116757W WO 2023077938 A1 WO2023077938 A1 WO 2023077938A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
image signal
signal processing
processing module
video
Prior art date
Application number
PCT/CN2022/116757
Other languages
French (fr)
Chinese (zh)
Inventor
侯伟龙
金杰
李子荣
Original Assignee
荣耀终端有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2023077938A1 publication Critical patent/WO2023077938A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems

Abstract

The present application relates to the technical field of terminals, and discloses a video frame generation method and apparatus, an electronic device, and a storage medium. The method comprises: an image sensor outputs first raw data; a first image signal processing module obtains the first raw data; the first image signal processing module copies the first raw data to obtain second raw data; the first image signal processing module performs image enhancement processing on the first raw data to obtain video enhancement data; the first image signal processing module sends the video enhancement data and the second raw data to a second image signal processing module; and the second image signal processing module generates a video frame on the basis of the video enhancement data and the second raw data. According to the present application, the image enhancement processing is performed by means of the first image signal processing module, and the first image signal processing module further provides, for the second image signal processing module, the second raw data that can be used for adjusting an exposure parameter, so that it can be ensured that a clear video frame can be obtained.

Description

生成视频帧的方法、装置、电子设备及存储介质Method, device, electronic device and storage medium for generating video frames
本申请要求于2021年11月5日提交到国家知识产权局、申请号为202111316825.0、申请名称为“生成视频帧的方法、电子设备及存储介质”的中国专利申请的优先权,以及要求于2022年3月10日提交到国家知识产权局、申请号为202210254250.2、申请名称为“生成视频帧的方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the State Intellectual Property Office on November 5, 2021, with the application number 202111316825.0, and the application name is "Method for Generating Video Frames, Electronic Devices, and Storage Medium", and claims that it will be filed in 2022 The priority of a Chinese patent application filed with the State Intellectual Property Office on March 10, 202210254250.2 and titled "Method, device, electronic device, and storage medium for generating video frames", the entire contents of which are incorporated by reference in In this application.
技术领域technical field
本申请涉及终端技术领域,尤其涉及一种生成视频帧的方法、装置、电子设备及存储介质。The present application relates to the technical field of terminals, and in particular to a method, device, electronic equipment and storage medium for generating video frames.
背景技术Background technique
随着终端技术的快速发展,诸如手机之类的电子设备的拍摄水平逐渐提高。尤其是在夜景场景下,电子设备在拍摄图像时,能够做到高光不过曝,暗调不欠曝,也即可以使得拍摄图像中无论高光部分还是暗调部分,细节都很清晰。With the rapid development of terminal technology, the shooting level of electronic devices such as mobile phones is gradually improving. Especially in night scenes, when electronic equipment is shooting images, it can ensure that the highlights are not overexposed and the darks are not underexposed, which means that the details of the captured images are very clear regardless of the highlights or dark parts.
在相关技术中,为了达到上述效果,电子设备在通过摄像头拍摄图像,通过片上系统(System on Chip,SOC)中集成的图像信号处理器(Image Signal Processing,ISP)(下文简称为内置ISP)处理拍摄图像,对拍摄图像进行图像增强处理,包括且不限于曝光参数调整、白平衡、对焦、降噪锐化等,然后通过多帧处理后得到细节清晰的拍摄图像。In related technologies, in order to achieve the above effects, the electronic device takes images through the camera and processes them through the image signal processor (Image Signal Processing, ISP) (hereinafter referred to as the built-in ISP) integrated in the system on chip (System on Chip, SOC). Take an image, perform image enhancement processing on the captured image, including but not limited to exposure parameter adjustment, white balance, focus, noise reduction and sharpening, etc., and then obtain a captured image with clear details after multi-frame processing.
然而,在电子设备采集视频的情况下,由于视频具有实时性,无法采用类似拍照的复杂多帧类增强处理算法,视频画面的显示效果往往明显差于拍摄图像。However, in the case of video capture by electronic equipment, due to the real-time nature of video, complex multi-frame enhancement processing algorithms similar to those of taking photos cannot be used, and the display effect of video images is often significantly worse than that of captured images.
发明内容Contents of the invention
本申请提供一种生成视频帧的方法、装置、电子设备及存储介质,解决了现有技术中无法采用类似拍照的复杂多帧类增强处理算法,视频画面的显示效果往往明显差于拍摄图像的问题。The present application provides a method, device, electronic equipment and storage medium for generating video frames, which solves the problem that complex multi-frame enhancement processing algorithms similar to photographing cannot be used in the prior art, and the display effect of video images is often significantly worse than that of captured images. question.
为达到上述目的,本申请采用如下技术方案:In order to achieve the above object, the application adopts the following technical solutions:
第一方面,提供一种生成视频帧的方法,应用于电子设备,所述电子设备包括图像感应器、第一图像信号处理模块以及第二图像信号处理模块,所述方法包括:In a first aspect, a method for generating a video frame is provided, which is applied to an electronic device, and the electronic device includes an image sensor, a first image signal processing module, and a second image signal processing module, and the method includes:
所述图像感应器输出第一原始数据;The image sensor outputs first raw data;
所述第一图像信号处理模块获取所述第一原始数据;The first image signal processing module acquires the first raw data;
所述第一图像信号处理模块复制所述第一原始数据,得到第二原始数据;The first image signal processing module copies the first original data to obtain second original data;
所述第一图像信号处理模块对所述第一原始数据进行图像增强处理,得到视频增强数据;The first image signal processing module performs image enhancement processing on the first raw data to obtain video enhancement data;
所述第一图像信号处理模块将所述视频增强数据以及所述第二原始数据发送给所述第二图像信号处理模块;The first image signal processing module sends the video enhancement data and the second original data to the second image signal processing module;
所述第二图像信号处理模块基于所述视频增强数据和所述第二原始数据,生成视 频帧。The second image signal processing module generates a video frame based on the video enhancement data and the second original data.
如此,通过第一图像信号处理模块进行图像增强处理,且第一图像信号处理模块为第二图像信号处理模块还提供了可以用于调整曝光参数的第二原始数据,如此可以保证能够得到清晰的视频帧。In this way, image enhancement processing is performed by the first image signal processing module, and the first image signal processing module also provides the second image signal processing module with second raw data that can be used to adjust exposure parameters, thus ensuring that clear video frame.
作为本申请的一个示例,所述第一原始数据包括同一时间段内采集的长曝光数据和短曝光数据,所述第一图像信号处理模块对所述第一原始数据进行图像增强处理,包括:As an example of the present application, the first raw data includes long exposure data and short exposure data collected in the same time period, and the first image signal processing module performs image enhancement processing on the first raw data, including:
所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据进行融合处理,得到融合原始数据;The first image signal processing module fuses the long exposure data and the short exposure data to obtain fused original data;
所述第一图像信号处理模块对所述融合原始数据进行降噪处理。The first image signal processing module performs noise reduction processing on the fusion original data.
如此,可以使得后续将同一时间段内的长曝光数据和短曝光数据进行融合后输出高动态视频帧。In this way, the long-exposure data and the short-exposure data within the same time period can be fused subsequently to output high dynamic video frames.
作为本申请的一个示例,所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据进行融合处理,包括:As an example of the present application, the first image signal processing module fuses the long exposure data and the short exposure data, including:
所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据输入至第一目标模型中,由所述第一目标模型进行融合处理,所述第一目标模型能够对任意的长曝光数据和短曝光数据进行融合处理。The first image signal processing module inputs the long-exposure data and the short-exposure data into a first object model, and performs fusion processing by the first object model, and the first object model can Exposure data and short exposure data are fused.
如此,通过第一目标模型进行融合处理,可以提高融合效率。In this way, fusion processing is performed through the first target model, which can improve fusion efficiency.
作为本申请的一个示例,所述第一图像信号处理模块对所述融合原始数据进行降噪处理,包括:As an example of the present application, the first image signal processing module performs noise reduction processing on the fused raw data, including:
所述第一图像信号处理模块将所述融合原始数据输入至第二目标模型中,由所述第二目标模型进行降噪处理,所述第二目标模型能够对任意的原始数据进行降噪处理。The first image signal processing module inputs the fused raw data into a second target model, and the second target model performs noise reduction processing, and the second target model can perform noise reduction processing on any raw data .
如此,通过第二目标模型进行降噪处理,可以提高降噪效率。In this way, noise reduction efficiency can be improved by using the second target model to perform noise reduction processing.
作为本申请的一个示例,所述第一图像信号处理模块中包括多个第二目标模型,所述多个第二目标模型中的每个第二目标模型对应有曝光数值范围;As an example of the present application, the first image signal processing module includes a plurality of second target models, and each second target model in the plurality of second target models corresponds to an exposure value range;
所述方法还包括:The method also includes:
所述第一图像信号处理模块接收目标曝光数据,所述目标曝光数据是由所述第二图像信号处理模块基于第一曝光数据确定,所述第一曝光数据是由所述第二图像信号处理模块基于所述第二原始数据进行曝光数据统计得到,所述目标曝光数据用于调整所述图像感应器的曝光参数;The first image signal processing module receives target exposure data, the target exposure data is determined by the second image signal processing module based on the first exposure data, and the first exposure data is determined by the second image signal processing module The module obtains exposure data statistics based on the second raw data, and the target exposure data is used to adjust the exposure parameters of the image sensor;
所述第一图像信号处理模块根据所述目标曝光数据、以及所述每个第二目标模型对应的曝光数值范围,从所述多个第二目标模型中选择一个第二目标模型,选择的第二目标模型用于降噪处理。The first image signal processing module selects a second target model from the plurality of second target models according to the target exposure data and the exposure value range corresponding to each second target model, and the selected second target model A two-objective model is used for denoising.
如此,根据目标曝光数据所属的曝光数值范围,从多个第二目标模型中选择用于下一次的降噪处理的第二目标模型,从而可以能够对下一次的视频数据进行合理的降噪处理,进而提高降噪效果。In this way, according to the exposure value range to which the target exposure data belongs, a second target model for the next noise reduction process is selected from multiple second target models, so that a reasonable noise reduction process can be performed on the next video data , thereby improving the noise reduction effect.
作为本申请的一个示例,所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据进行融合处理之前,还包括:As an example of the present application, before the first image signal processing module fuses the long exposure data and the short exposure data, it further includes:
所述第一图像信号处理模块对所述长曝光数据和所述短曝光数据进行预处理,所 述预处理包括镜头校正LSC处理、黑电平补偿BLC处理、坏像素校正BPC处理、颜色插值处理中的至少一项;The first image signal processing module preprocesses the long exposure data and the short exposure data, and the preprocessing includes lens correction LSC processing, black level compensation BLC processing, bad pixel correction BPC processing, and color interpolation processing at least one of the
所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据进行融合处理,包括:The first image signal processing module fuses the long exposure data and the short exposure data, including:
所述第一图像信号处理模块将预处理后的所述长曝光数据和所述短曝光数据进行融合处理。The first image signal processing module fuses the preprocessed long exposure data and the short exposure data.
如此,通过分别对长曝光数据和短曝光数据进行预处理,可以提高后续得到的视频帧的清晰度。In this way, by performing preprocessing on the long-exposure data and the short-exposure data respectively, the definition of subsequent video frames can be improved.
作为本申请的一个示例,所述第二图像信号处理模块基于所述视频增强数据和所述第二原始数据,生成视频帧,包括:As an example of the present application, the second image signal processing module generates a video frame based on the video enhancement data and the second original data, including:
所述第二图像信号处理模块对所述视频增强数据进行格式转换处理,得到YUV图像;The second image signal processing module performs format conversion processing on the video enhancement data to obtain a YUV image;
所述第二图像信号处理模块基于所述第二原始数据,确定目标数据,所述目标数据用于调整所述YUV图像的图像质量;The second image signal processing module determines target data based on the second raw data, and the target data is used to adjust the image quality of the YUV image;
所述第二图像信号处理模块基于所述目标数据调整所述YUV图像,并将调整后的所述YUV图像作为所述视频帧。The second image signal processing module adjusts the YUV image based on the target data, and uses the adjusted YUV image as the video frame.
如此,通过第二图像信号处理模块对视频增强数据进行格式转换处理,以及基于第二原始数据确定目标数据,并根据目标数据对经格式转换处理后得到的YUV图像进行优化,从而得到画面清晰的视频帧。In this way, the format conversion process is performed on the video enhancement data through the second image signal processing module, and the target data is determined based on the second raw data, and the YUV image obtained after the format conversion process is optimized according to the target data, so as to obtain a clear picture video frame.
作为本申请的一个示例,所述图像感应器输出第一原始数据,包括:As an example of the present application, the image sensor outputs first raw data, including:
通过所述电子设备中的相机应用检测到夜景视频拍摄指令,所述夜景视频拍摄指令用于指示在夜景模式下进行视频录制;A night scene video shooting instruction is detected through the camera application in the electronic device, and the night scene video shooting instruction is used to indicate video recording in night scene mode;
响应于所述夜景视频拍摄指令,所述图像感应器输出所述第一原始数据。In response to the night scene video shooting instruction, the image sensor outputs the first raw data.
如此,在夜景场景下,电子设备获取第一原始数据,通过本申请提供的方法对摄像头采集的第一原始数据进行处理,以使得得到的视频帧的高亮区域不会过于曝光且暗调区域不会过暗,从而得到画面清晰的视频帧。In this way, in the night scene, the electronic device acquires the first raw data, and processes the first raw data collected by the camera through the method provided in this application, so that the highlighted area of the obtained video frame will not be overexposed and the darkened area will not be overexposed. Not too dark, resulting in a clear video frame.
作为本申请的一个示例,所述第二图像信号处理模块包括芯片级系统SOC中集成的ISP,第一图像信号处理模块包括所述SOC外部的ISP。As an example of the present application, the second image signal processing module includes an ISP integrated in a system-on-a-chip (SOC), and the first image signal processing module includes an ISP outside the SOC.
如此,通过外置ISP来分担对视频帧的处理任务,可以减小SOC中内置ISP的负担,从而实现对视频帧的实时处理,以便于能够得到满足需求的视频画面。In this way, by sharing the task of processing video frames through an external ISP, the burden of the built-in ISP in the SOC can be reduced, thereby realizing real-time processing of video frames, so that video images that meet the requirements can be obtained.
第二方面,提供了一种生成视频帧的装置,所述装置包括:图像感应器节点、第一图像信号处理模块以及第二图像信号处理模块;In a second aspect, a device for generating a video frame is provided, the device comprising: an image sensor node, a first image signal processing module, and a second image signal processing module;
所述图像感应器节点,用于输出第一原始数据;The image sensor node is configured to output first raw data;
所述第一图像信号处理模块,用于获取所述第一原始数据,复制所述第一原始数据,得到第二原始数据,对所述第一原始数据进行图像增强处理,得到视频增强数据,将所述视频增强数据以及所述第二原始数据发送给所述第二图像信号处理模块;The first image signal processing module is configured to acquire the first original data, copy the first original data to obtain second original data, and perform image enhancement processing on the first original data to obtain video enhanced data, sending the enhanced video data and the second raw data to the second image signal processing module;
所述第二图像信号处理模块,用于基于所述视频增强数据和所述第二原始数据,生成视频帧。The second image signal processing module is configured to generate a video frame based on the video enhancement data and the second original data.
作为本申请的一个示例,所述第一原始数据包括同一时间段内采集的长曝光数据 和短曝光数据;所述第一图像信号处理模块用于:As an example of the present application, the first raw data includes long exposure data and short exposure data collected in the same time period; the first image signal processing module is used for:
将所述长曝光数据和所述短曝光数据进行融合处理,得到融合原始数据;performing fusion processing on the long exposure data and the short exposure data to obtain fusion original data;
对所述融合原始数据进行降噪处理。Perform noise reduction processing on the fused raw data.
作为本申请的一个示例,所述第一图像信号处理模块用于:As an example of the present application, the first image signal processing module is used for:
将所述长曝光数据和所述短曝光数据输入至第一目标模型中,由所述第一目标模型进行融合处理,所述第一目标模型能够对任意的长曝光数据和短曝光数据进行融合处理。Inputting the long exposure data and the short exposure data into a first target model, and performing fusion processing by the first target model, and the first target model can fuse any long exposure data and short exposure data deal with.
作为本申请的一个示例,所述第一图像信号处理模块用于:As an example of the present application, the first image signal processing module is used for:
将所述融合原始数据输入至第二目标模型中,由所述第二目标模型进行降噪处理,所述第二目标模型能够对任意的原始数据进行降噪处理。The fused original data is input into a second target model, and the noise reduction process is performed by the second target model, and the second target model can perform noise reduction process on any original data.
作为本申请的一个示例,所述第一图像信号处理模块中包括多个第二目标模型,所述多个第二目标模型中的每个第二目标模型对应有曝光数值范围;所述第一图像信号处理器还用于:As an example of the present application, the first image signal processing module includes a plurality of second target models, and each second target model in the plurality of second target models corresponds to an exposure value range; the first Image signal processors are also used to:
接收目标曝光数据,所述目标曝光数据是由所述第二图像信号处理模块基于第一曝光数据确定,所述第一曝光数据是由所述第二图像信号处理模块基于所述第二原始数据进行曝光数据统计得到,所述目标曝光数据用于调整所述图像感应器的曝光参数;receiving target exposure data, the target exposure data is determined by the second image signal processing module based on the first exposure data, the first exposure data is determined by the second image signal processing module based on the second raw data Obtained by performing statistics on exposure data, the target exposure data is used to adjust the exposure parameters of the image sensor;
根据所述目标曝光数据、以及所述每个第二目标模型对应的曝光数值范围,从所述多个第二目标模型中选择一个第二目标模型,选择的第二目标模型用于降噪处理。According to the target exposure data and the exposure value range corresponding to each second target model, select a second target model from the plurality of second target models, and the selected second target model is used for noise reduction processing .
作为本申请的一个示例,所述第一图像信号处理模块用于:As an example of the present application, the first image signal processing module is used for:
对所述长曝光数据和所述短曝光数据进行预处理,所述预处理包括镜头校正LSC处理、黑电平补偿BLC处理、坏像素校正BPC处理、颜色插值处理中的至少一项;Preprocessing the long exposure data and the short exposure data, the preprocessing includes at least one of lens correction LSC processing, black level compensation BLC processing, bad pixel correction BPC processing, and color interpolation processing;
将预处理后的所述长曝光数据和所述短曝光数据进行融合处理。The preprocessed long exposure data and the short exposure data are fused.
作为本申请的一个示例,所述第二图像信号处理模块用于:As an example of the present application, the second image signal processing module is used for:
对所述视频增强数据进行格式转换处理,得到YUV图像;Perform format conversion processing on the video enhancement data to obtain a YUV image;
基于所述第二原始数据确定目标数据,所述目标数据用于调整所述YUV图像的图像质量;determining target data based on the second raw data, the target data being used to adjust the image quality of the YUV image;
基于所述目标数据调整所述YUV图像,并将调整后的所述YUV图像作为所述视频帧。adjusting the YUV image based on the target data, and using the adjusted YUV image as the video frame.
作为本申请的一个示例,所述图像感应器节点用于:As an example of the present application, the image sensor node is used for:
通过所述电子设备中的相机应用检测到夜景视频拍摄指令,所述夜景视频拍摄指令用于指示在夜景模式下进行视频录制;A night scene video shooting instruction is detected through the camera application in the electronic device, and the night scene video shooting instruction is used to indicate video recording in night scene mode;
响应于所述夜景视频拍摄指令,输出所述第一原始数据。In response to the night scene video shooting instruction, the first raw data is output.
作为本申请的一个示例,所述第二图像信号处理模块是芯片级系统SOC中集成的ISP,第一图像信号处理模块是所述SOC外部的ISP。As an example of the present application, the second image signal processing module is an ISP integrated in a system-on-a-chip (SOC), and the first image signal processing module is an ISP outside the SOC.
第三方面,提供一种电子设备,所述电子设备的结构中包括处理器和存储器,所述存储器用于存储支持电子设备执行上述第一方面任一所述的方法的程序,以及存储用于实现上述第一方面任一所述的方法所涉及的数据;所述处理器被配置为用于执行所述存储器中存储的程序。所述电子设备还可以包括通信总线,所述通信总线用于在所述处理器与所述存储器之间建立连接。In the third aspect, an electronic device is provided, the structure of the electronic device includes a processor and a memory, and the memory is used to store a program that supports the electronic device to execute the method described in any one of the above-mentioned first aspects, and to store a program for The data involved in implementing the method described in any one of the above first aspects; the processor is configured to execute the program stored in the memory. The electronic device may also include a communication bus for establishing a connection between the processor and the memory.
第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行如上述第一方面任意一项所述的方法。In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer is made to execute the method described in any one of the above-mentioned first aspects.
第五方面,提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。According to a fifth aspect, there is provided a computer program product containing instructions, which, when run on a computer, causes the computer to execute the method described in the first aspect above.
上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained by the above-mentioned second aspect, third aspect, fourth aspect and fifth aspect are similar to those obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的一种摄像头的空间位置分布示意图;FIG. 1 is a schematic diagram of spatial position distribution of a camera provided in an embodiment of the present application;
图2为本申请实施例提供的一种电子设备的结构示意图;FIG. 2 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
图3为本申请实施例提供的一种电子设备的软件框架示意图;FIG. 3 is a schematic diagram of a software framework of an electronic device provided in an embodiment of the present application;
图4为本申请实施例提供的一种应用场景的示意图;FIG. 4 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图5为本申请实施例提供的另一种应用场景的示意图;FIG. 5 is a schematic diagram of another application scenario provided by the embodiment of the present application;
图6为本申请实施例提供的一种生成视频帧的方法的流程示意图;FIG. 6 is a schematic flowchart of a method for generating a video frame provided in an embodiment of the present application;
图7为本申请实施例提供的一种硬件的结构示意图;FIG. 7 is a schematic structural diagram of a hardware provided by an embodiment of the present application;
图8为本申请实施例提供的另一种生成视频帧的方法的流程示意图。FIG. 8 is a schematic flowchart of another method for generating video frames provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manner of the present application will be further described in detail below in conjunction with the accompanying drawings.
应当理解的是,本申请提及的“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,比如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,比如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。It should be understood that the "plurality" mentioned in this application means two or more. In the description of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in this article is just a description of the relationship between associated objects, It means that there can be three kinds of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in order to clearly describe the technical solution of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not necessarily limit the difference.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
在对本申请实施例提供的方法进行详细介绍之前,先对本申请实施例涉及的名词和执行主体进行介绍。Before introducing the method provided by the embodiment of the present application in detail, the nouns and execution subjects involved in the embodiment of the present application are firstly introduced.
首先,对本申请实施例涉及的名词进行介绍。First, the nouns involved in the embodiments of the present application are introduced.
曝光:根据曝光时间的长短可以分为长曝光和短曝光。曝光时间越长,光圈的进光量越大。反之,曝光时间越短,光圈的进光量越小。Exposure: According to the length of exposure time, it can be divided into long exposure and short exposure. The longer the exposure time, the greater the amount of light entering the aperture. Conversely, the shorter the exposure time, the smaller the amount of light entering the aperture.
3A统计算法:包括自动曝光(automatic exposure,AE)算法、自动对焦(automatic  focus,AF)算法、和自动白平衡(automatic white balance,AWB)算法。3A statistical algorithm: including automatic exposure (automatic exposure, AE) algorithm, automatic focus (automatic focus, AF) algorithm, and automatic white balance (automatic white balance, AWB) algorithm.
AE:是指相机根据光线条件自动确定曝光量。成像系统中一般都会有AE功能,该功能直接关系到图像画面的亮度和图像质量,也即会决定图像的明暗。AE: refers to the camera automatically determines the exposure according to the lighting conditions. The imaging system generally has an AE function, which is directly related to the brightness and image quality of the image screen, that is, it will determine the brightness and darkness of the image.
AF:是指由相机根据被摄体距离的远近,自动地调节摄像头的对焦距离,也即通过测距来调整摄像头中镜片形成焦点,从而使得相机内的影像清晰。AF: It means that the camera automatically adjusts the focus distance of the camera according to the distance of the subject, that is, the lens in the camera is adjusted to form the focus through distance measurement, so that the image in the camera is clear.
AWB:主要用于解决图像偏色的问题。如果图像存在偏色情况,则可以通过AWB算法进行矫正。AWB: Mainly used to solve the problem of image color cast. If there is a color cast in the image, it can be corrected by the AWB algorithm.
视场角:(field angle,FOV),是指摄像头所能覆盖的范围。FOV越大,摄像头能够容纳的景物越多,不难理解,若被摄体没有位于摄像头的FOV内就不会被摄像头拍摄到。Field of view: (field angle, FOV), refers to the range that the camera can cover. The larger the FOV, the more scenes the camera can accommodate. It is not difficult to understand that if the subject is not within the FOV of the camera, it will not be captured by the camera.
图像感应器(Sensor):是相机的核心部件,作用是将光信号转换成电信号,以便于后续处理和存储。工作原理是通过光敏元件在光照的条件下产生电荷,电荷转移产生电流,电流经过整流放大、模数转换形成数字信号。图像感应器一般包括两类:电荷耦合器件(charge coupled device,CCD)和互补金属氧化物半导体(complementary metal oxide semiconductor,CMOS)。Image sensor (Sensor): It is the core component of the camera, and its function is to convert optical signals into electrical signals for subsequent processing and storage. The working principle is that the photosensitive element generates charge under the condition of light, and the charge transfer generates a current, and the current is rectified and amplified, and converted into a digital signal to form a digital signal. Image sensors generally include two types: charge coupled device (CCD) and complementary metal oxide semiconductor (complementary metal oxide semiconductor, CMOS).
RAW数据:在本申请实施例中也称为原始数据,是指相机中的CCD或者CMOS图像感应器将捕捉到的光源信号转化为数据信号的原始数据。也即可以理解为是未经过加工的数据,能够用于描述图像感应器接受到的各种光的强度。RAW data: also referred to as raw data in this embodiment of the application, refers to the raw data that the CCD or CMOS image sensor in the camera converts the captured light source signal into a data signal. That is to say, it can be understood as unprocessed data, which can be used to describe the intensity of various lights received by the image sensor.
接下来对本申请实施例涉及的执行主体进行介绍。Next, the execution subject involved in the embodiment of the present application will be introduced.
本申请实施例提供的方法可以由具有拍摄功能的电子设备执行,电子设备配置有一个或者多个摄像头,多个摄像头中的不同摄像头具有不同的拍摄功能。譬如,电子设备配置有但不限于广角摄像头、长焦摄像头(比如潜望式长焦摄像头)、黑白摄像头、超广角摄像头中的至少一个。一个或者多个摄像头可以包括前置摄像头和/或后置摄像头。作为本申请的一个示例,电子设备配置有多个后置摄像头,多个后置摄像头包括一个主摄像头和至少一个辅摄像头,譬如请参考图1,多个后置摄像头的空间分布可以如图1中的(a)图所示,或者,多个后置摄像头的空间分布也可以如图1中的(b)图所示,该多个后置摄像头分别为摄像头00、摄像头01、摄像头02、摄像头03,示例性地,摄像头00为主摄像头,其他为辅摄像头。电子设备在启动相机应用后,通常默认通过主摄像头进行拍摄,在相机切换后,电子设备根据切换需求从至少一个辅摄像头中选择合适的辅摄像头,并通过选择的辅摄像头进行拍摄。作为示例而非限定,电子设备可以是但不限于手机运动相机(GoPro)、数码相机、平板电脑、桌面型、膝上型、手持计算机、笔记本电脑、车载设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、手机等,本申请实施例对此不作限定。The method provided in the embodiment of the present application may be executed by an electronic device having a shooting function. The electronic device is configured with one or more cameras, and different cameras among the multiple cameras have different shooting functions. For example, the electronic device is configured with at least one of a wide-angle camera, a telephoto camera (such as a periscope telephoto camera), a black-and-white camera, and an ultra-wide-angle camera. The one or more cameras may include a front camera and/or a rear camera. As an example of the present application, the electronic device is equipped with multiple rear cameras, and the multiple rear cameras include a main camera and at least one auxiliary camera. For example, please refer to FIG. 1, the spatial distribution of multiple rear cameras can be shown in FIG. 1 As shown in figure (a) in Figure 1, or, the spatial distribution of multiple rear cameras can also be shown in figure (b) in Figure 1, the multiple rear cameras are respectively camera 00, camera 01, camera 02, The camera 03, for example, the camera 00 is the main camera, and the others are auxiliary cameras. After starting the camera application, the electronic device usually shoots through the main camera by default. After the camera is switched, the electronic device selects a suitable auxiliary camera from at least one auxiliary camera according to the switching requirement, and shoots through the selected auxiliary camera. By way of example and not limitation, an electronic device may be, but not limited to, a mobile phone action camera (GoPro), digital camera, tablet computer, desktop, laptop, handheld computer, notebook computer, vehicle-mounted device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook, cellular phone, personal digital assistant (personal digital assistant, PDA), augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) equipment, mobile phone, etc. Not limited.
请参阅图2,图2是本申请实施例提供的一种电子设备的结构示意图。电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池 142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,ISP191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。在一个示例中,电子设备中包括的ISP 191的数量是多个,图2中仅示例性地示出了一个。Please refer to FIG. 2 . FIG. 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2. Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, ISP191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM) card interface 195 and the like. In one example, the number of ISPs 191 included in the electronic device is multiple, and only one is exemplarily shown in FIG. 2 .
可以理解的是,本实施例示意的结构并不构成对电子设备100的具体限定。在另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure shown in this embodiment does not constitute a specific limitation on the electronic device 100 . In other embodiments, the electronic device 100 may include more or fewer components than shown, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),ISP,控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an ISP, a controller , memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备100供电。The charging management module 140 is configured to receive a charging input from a charger. Wherein, the charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger through the USB interface 130 . In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device 100 through the power management module 141 .
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。 在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 . The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be disposed in the processor 110 . In some other embodiments, the power management module 141 and the charging management module 140 may also be set in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
电子设备100可以通过ISP 191,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP 191, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
ISP 191用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP 191处理,转化为肉眼可见的图像。ISP 191还可以对图像的噪点,亮度,肤色进行算法优化。ISP 191还可以对拍摄场景的曝光,色温等参数优化。The ISP 191 is used for processing the data fed back by the camera 193. For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP 191 for processing, and converts it into an image visible to the naked eye. ISP 191 can also optimize the algorithm for image noise, brightness, and skin tone. ISP 191 can also optimize the exposure, color temperature and other parameters of the shooting scene.
在一些实施例中,ISP 191可以包括SOC中集成的内置ISP和设于SOC外部的外置ISP。相比较来说,外置ISP的内部结构与内置ISP的内部结构类似或相同,不同的是,外置ISP与内置ISP对视频数据进行处理时采用的方法不同。作为本申请的一个示例,外置ISP采用人工智能方法(比如通过网络模型等)对视频数据进行处理,而内置ISP采用其他算法对视频数据进行处理。In some embodiments, the ISP 191 may include a built-in ISP integrated in the SOC and an external ISP provided outside the SOC. In comparison, the internal structure of the external ISP is similar or the same as that of the built-in ISP. The difference is that the methods used by the external ISP and the built-in ISP to process video data are different. As an example of this application, the external ISP uses artificial intelligence methods (such as through network models, etc.) to process video data, while the built-in ISP uses other algorithms to process video data.
作为本申请的一个示例,外置ISP主要有两方面作用:一方面,用于对摄像头采集的RAW数据进行融合处理和图像增强处理,从而为内置ISP提供增强后的视频数据;另一方面,用于对摄像头采集的RAW数据进行路由,以为内置ISP提供一份RAW数据,从而便于内置ISP能够准确地确定当前的曝光数据,进而便于内置ISP根据曝光数据动态地调整摄像头的曝光参数。As an example of this application, the external ISP mainly has two functions: on the one hand, it is used to perform fusion processing and image enhancement processing on the RAW data collected by the camera, so as to provide enhanced video data for the built-in ISP; on the other hand, It is used to route the RAW data collected by the camera to provide a copy of RAW data for the built-in ISP, so that the built-in ISP can accurately determine the current exposure data, and then facilitate the built-in ISP to dynamically adjust the exposure parameters of the camera according to the exposure data.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP 191转换成数字图像信号。ISP 191将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB(red green blue红色绿色蓝色),YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP 191 for conversion into a digital image signal. ISP 191 outputs the digital image signal to DSP for processing. DSP converts digital image signals into standard RGB (red green blue red green blue), YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其 他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 . The internal memory 121 may include an area for storing programs and an area for storing data.
其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动终端设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used for connecting wired earphones. The earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100 . The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like. The SIM card interface 195 is used for connecting a SIM card. The SIM card can be connected and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 . The electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc.
在一个实施例中,电子设备100的软件系统可以采用分层架构,事件驱动架构, 微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。In one embodiment, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the software structure of the electronic device 100 is exemplarily described by taking an Android system with a layered architecture as an example.
图3是本申请实施例提供的电子设备100的软件结构框图。FIG. 3 is a block diagram of the software structure of the electronic device 100 provided by the embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,Android系统从上至下分别为应用程序层,硬件抽象层(Hardware Abstract Layer,HAL)、内核层、硬件层。另外,在应用程序层与HAL之间还包括应用程序框架层(Application Framework)(图3中未示出),本申请实施例不做重点介绍。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is respectively an application program layer, a hardware abstract layer (Hardware Abstract Layer, HAL), a kernel layer, and a hardware layer from top to bottom. In addition, an application framework layer (Application Framework) (not shown in FIG. 3 ) is also included between the application layer and the HAL, which is not highlighted in this embodiment of the present application.
应用程序层可以包括一系列应用程序包。如图3所示,应用程序包可以包括相机,图库等应用程序。The application layer can consist of a series of application packages. As shown in Figure 3, the application package may include application programs such as a camera and a gallery.
作为本申请的一个示例,相机应用支持超夜视频模式,电子设备在超夜视频模式下能够在夜景中拍摄出清晰、亮暗分明的视频。As an example of the present application, the camera application supports a super night video mode, and in the super night video mode, the electronic device can shoot clear, bright and dark videos in night scenes.
作为本申请的一个示例,应用程序层还提供有预加载外置ISP服务。由于外置ISP内部的存储器通常是随机存取存储器(Random Access Memory,RAM),根据RAM的特性可知,RAM在断电的情况下无法保存数据,所以,通常会将外置ISP在运行过程中所需使用的诸如外置ISP SDK、模型(譬如包括下文所述的第一目标模型、第二目标模型)之类的数据存储在系统内存中。在启动相机应用时,应用程序层开启预加载外置ISP服务,使得外置ISP驱动控制外置ISP提前上电,将外置ISP运行过程中所需的数据从系统内存中加载至外置ISP内部的RAM,便于外置ISP能够在超夜视频模式下执行对应的功能(譬如数据融合、图像增强处理等功能)。As an example of this application, the application layer also provides pre-loaded external ISP services. Since the internal memory of the external ISP is usually random access memory (Random Access Memory, RAM), according to the characteristics of RAM, RAM cannot save data in the case of power failure, so the external ISP is usually stored during operation. The required data such as external ISP SDK and models (for example, including the first target model and the second target model described below) are stored in the system memory. When the camera application is started, the application layer starts the preloading external ISP service, so that the external ISP driver controls the external ISP to be powered on in advance, and loads the data required for the external ISP during operation from the system memory to the external ISP The internal RAM is convenient for the external ISP to perform corresponding functions (such as data fusion, image enhancement processing, etc.) in the super night video mode.
作为本申请的一个示例,图库应用程序中可以提供由摄像头录制的视频,如此用户可以从图库应用程序中查看所录制的视频。As an example of this application, the video recorded by the camera can be provided in the gallery application, so that the user can view the recorded video from the gallery application.
HAL层主要包括视频模块,用于通过摄像头的图像感知器获取RAW数据,并分别通过外置ISP、内置ISP对RAW数据进行融合、增强、优化等处理,得到增强清晰度和降噪效果的视频帧。之后将得到的视频帧发送至显示屏进行显示。另外,视频模块还将录制的视频存至图库应用程序中,以便于用户查看。The HAL layer mainly includes a video module, which is used to obtain RAW data through the image sensor of the camera, and perform fusion, enhancement, optimization and other processing on the RAW data through the external ISP and the built-in ISP respectively to obtain video with enhanced clarity and noise reduction effect frame. The resulting video frames are then sent to the display for display. In addition, the video module also saves the recorded video to the gallery application for easy viewing by users.
在一个示例中,视频模块包括图像感应器节点、内置ISP节点、外置ISP节点。各个节点可以理解为是对底层硬件执行的功能的封装,可供上层(应用程序层)感知和调用。示例性地,图像感应器节点是对底层摄像头中的图像感应器的功能的封装;内置ISP节点是对底层内置ISP的功能的封装;外置ISP节点是对底层外置ISP的功能的封装。在实施中,视频模块通过图像感应器节点、内置ISP节点、外置ISP节点之间的交互实现上述功能。In one example, the video module includes an image sensor node, a built-in ISP node, and an external ISP node. Each node can be understood as an encapsulation of the functions performed by the underlying hardware, which can be perceived and invoked by the upper layer (application layer). Exemplarily, the image sensor node encapsulates the function of the image sensor in the bottom camera; the built-in ISP node encapsulates the function of the bottom built-in ISP; the external ISP node encapsulates the function of the bottom external ISP. In implementation, the video module implements the above functions through the interaction between the image sensor node, the built-in ISP node, and the external ISP node.
外置ISP节点内部包括多个子模块,譬如包括路由子模块、第一预处理子模块、增强子模块。同理,多个子模块中的各个子模块可以理解为分别是对底层外置ISP中不同硬件的功能的封装,作为本申请的一个示例,路由子模块是对底层外置ISP中SIF的功能的封装,第一预处理子模块是对底层外置ISP中IFE的功能的封装,增强子模块是对底层外置ISP中神经网络处理器(neural network processing unit,NPU)的功能的封装。在实施中,外置ISP通过多个子模块的交互实现对应的功能。The external ISP node includes a plurality of submodules, for example, a routing submodule, a first preprocessing submodule, and an enhancement submodule. In the same way, each sub-module in the multiple sub-modules can be understood as the encapsulation of the functions of different hardware in the bottom external ISP respectively. As an example of this application, the routing sub-module is the function of the SIF in the bottom external ISP. Encapsulation, the first preprocessing sub-module is the encapsulation of the function of the IFE in the bottom external ISP, and the enhancement sub-module is the encapsulation of the function of the neural network processing unit (NPU) in the bottom external ISP. In implementation, the external ISP implements corresponding functions through the interaction of multiple sub-modules.
内置ISP节点的内部包括多个子模块,譬如包括第二预处理子模块以及优化处理 子模块。多个子模块中的各个子模块可以理解为分别是对底层内置ISP中不同硬件的功能的封装,作为本申请的一个示例,第二预处理子模块是对内置ISP中的一个或者多个图像前端引擎(image front end,IFE)的功能的封装;优化处理子模块是对底层内置ISP中的图像处理器(image processing engine,IPE)的功能的封装。在实施中,内置ISP通过多个子模块的交互实现对应的功能。The interior of the built-in ISP node includes multiple submodules, for example, the second preprocessing submodule and the optimization processing submodule. Each of the multiple sub-modules can be understood as encapsulating the functions of different hardware in the underlying built-in ISP. As an example of this application, the second preprocessing sub-module is for one or more image front-ends in the built-in ISP Encapsulation of the function of the engine (image front end, IFE); the optimization processing sub-module is the encapsulation of the function of the image processor (image processing engine, IPE) in the built-in ISP in the bottom layer. In implementation, the built-in ISP realizes the corresponding functions through the interaction of multiple sub-modules.
另外,HAL层还包括外置ISP软件开发包(software development kit,SDK),用于建立起外置ISP节点内部的多个子模块之间的交互。In addition, the HAL layer also includes an external ISP software development kit (software development kit, SDK), which is used to establish the interaction between multiple sub-modules inside the external ISP node.
内核层是硬件和软件之间的层。内核层包括但不限于摄像头驱动,内置ISP驱动,外置ISP驱动。The kernel layer is the layer between hardware and software. The kernel layer includes but not limited to camera driver, built-in ISP driver, and external ISP driver.
硬件层包括但不限于摄像头、内置ISP、外置ISP、显示屏。The hardware layer includes but not limited to camera, built-in ISP, external ISP, display.
下面结合夜景中录制视频,示例性说明电子设备100软件以及硬件的工作流程。In the following, the workflow of the software and hardware of the electronic device 100 will be exemplarily described in conjunction with video recording in the night scene.
在一个实施例中,若相机应用检测到在超夜视频模式下开启了视频拍摄,则向HAL层的视频模块下发通知。视频模块接收到通知后,建立起用于处理夜景视频的框架。具体地,视频模块通知摄像头驱动控制摄像头上电,以及通知内置ISP驱动控制内置ISP上电。相应的,摄像头驱动对摄像头进行驱动,摄像头加载完成后,通知摄像头驱动,由摄像头驱动通知视频模块摄像头已完成加载。另外,内置ISP驱动对内置ISP进行驱动,内置ISP加载完成后,通知内置ISP驱动,由内置ISP驱动通知视频模块内置ISP已完成加载。In one embodiment, if the camera application detects that video shooting is enabled in the super night video mode, it sends a notification to the video module at the HAL layer. After the video module receives the notification, it establishes a framework for processing the night scene video. Specifically, the video module notifies the camera driver to control the camera to be powered on, and notifies the built-in ISP driver to control the built-in ISP to be powered on. Correspondingly, the camera driver drives the camera, and after the camera is loaded, the camera driver is notified, and the camera driver notifies the video module that the camera has been loaded. In addition, the built-in ISP driver drives the built-in ISP, and after the built-in ISP is loaded, the built-in ISP driver is notified, and the built-in ISP driver notifies the video module that the built-in ISP has been loaded.
视频模块在确定摄像头、内置ISP和外置ISP(示例性的,加载时机是在相机应用启动后)均加载完成后,搭建起图像感应器节点、内置ISP节点以及外置ISP节点之间的交互。如此,就可以通过调用视频模块采集视频数据并进行处理,具体实现可以参见下文。After the video module determines that the camera, built-in ISP and external ISP (for example, the loading time is after the camera application starts) are all loaded, set up the interaction between the image sensor node, the built-in ISP node and the external ISP node . In this way, the video data can be collected and processed by calling the video module, and the specific implementation can be referred to below.
在介绍完本申请实施例涉及的名词和执行主体后,接下来以电子设备是包括多个后置摄像头的手机为例,对本申请实施例涉及的应用场景进行介绍。After introducing the nouns and execution subjects involved in the embodiments of the present application, the application scenarios involved in the embodiments of the present application will be introduced next by taking the electronic device as a mobile phone including multiple rear cameras as an example.
手机中存在相机应用,请参考图4中的(a)图,在一个实施例中,用户想要通过手机拍摄夜景视频,此时,用户可以点击手机中的相机应用的应用图标。响应于用户对相机应用的应用图标的触发操作,手机启动后置摄像头中的主摄像头,并为用户展示如图4中的(b)图所示的第一界面。There is a camera application in the mobile phone, please refer to the (a) figure in Figure 4, in one embodiment, the user wants to take a night scene video through the mobile phone, at this time, the user can click the application icon of the camera application in the mobile phone. In response to the user's trigger operation on the application icon of the camera application, the mobile phone starts the main camera in the rear camera, and displays the first interface shown in (b) of FIG. 4 to the user.
作为本申请的一个示例,第一界面中提供有“夜景”选项41,用户可以触发“夜景”选项41,响应于用户对“夜景”选项41的触发操作,手机展示夜景模式下的操作界面(称为第二界面),示例性地,第二界面如图4中的(c)图所示。第二界面中提供有第一切换选项42和第二切换选项43,其中,第一切换选项43用于在前置摄像头和后置摄像头之间进行切换。第二切换选项43用于在拍照模式和视频拍摄模式之间进行切换。As an example of the present application, a "night scene" option 41 is provided in the first interface, the user can trigger the "night scene" option 41, and in response to the user's trigger operation on the "night scene" option 41, the mobile phone displays the operation interface in the night scene mode ( referred to as the second interface), for example, the second interface is shown in (c) in FIG. 4 . The second interface provides a first switching option 42 and a second switching option 43, wherein the first switching option 43 is used to switch between the front camera and the rear camera. The second switch option 43 is used to switch between the camera mode and the video capture mode.
在一个示例中,在进入夜景模式后,也即在从图4中的(b)图切换到图4中的(c)图后,手机默认处于拍照模式(本申请实施例以该种模式为例进行说明),当用户想要拍摄夜景视频时,可以触发第二切换选项43,响应于用户对第二切换选项43的触发操作,手机从拍照模式切换至视频拍摄模式。In one example, after entering the night scene mode, that is, after switching from (b) in FIG. 4 to (c) in FIG. Example), when the user wants to shoot a night scene video, the second switch option 43 can be triggered, and in response to the trigger operation of the second switch option 43 by the user, the mobile phone switches from the camera mode to the video capture mode.
在另一个示例中,在进入夜景模式后,也即在从图4中的(b)图切换到图4中的(c)图后,手机也可以默认处于视频拍摄模式,在该种情况下,若用户想要拍摄夜景图像,可以触发第二切换选项43,响应于用户对第二切换选项43的触发操作,手机从视频拍摄模式切换至拍照模式。In another example, after entering the night scene mode, that is, after switching from (b) in Figure 4 to (c) in Figure 4, the mobile phone can also be in the video shooting mode by default, in this case , if the user wants to take a night scene image, the second switch option 43 can be triggered, and in response to the trigger operation of the second switch option 43 by the user, the mobile phone switches from the video shooting mode to the camera mode.
在一个实施例中,第二界面中还提供有拍摄选项44,用户可以触发拍摄选项44。响应于用户对拍摄选项44的触发操作,手机通过摄像头(如主摄像头)录制视频,譬如请继续参考图4,视频录制界面如图4中的(d)图所示。作为本申请的一个示例,在夜景场景下,手机通过本申请提供的方法对摄像头采集的视频数据进行处理,从而使得最终能够拍摄出画面清晰的视频帧。其中这里所述的画面清晰是指高亮区域不会过于曝光,暗调区域不会过暗。In one embodiment, a shooting option 44 is also provided in the second interface, and the user can trigger the shooting option 44 . In response to the user's trigger operation on the shooting option 44, the mobile phone records a video through a camera (such as a main camera). For example, please continue to refer to FIG. 4 , and the video recording interface is shown in (d) in FIG. 4 . As an example of the present application, in a night scene, the mobile phone processes the video data collected by the camera through the method provided in the present application, so that a clear video frame can be captured finally. The clarity of the picture mentioned here means that the highlighted areas will not be overexposed, and the dark areas will not be too dark.
在一个示例中,请继续参考图4中的(d)图,视频录制界面中提供有暂停选项45。在视频录制过程中,当用户想要暂停视频录制时,可以触发暂停选项45,响应于用户对暂停选项45的触发操作,手机暂停视频录制。In an example, please continue to refer to figure (d) in FIG. 4 , a pause option 45 is provided in the video recording interface. During the video recording process, when the user wants to pause the video recording, the pause option 45 can be triggered, and in response to the user's trigger operation on the pause option 45, the mobile phone pauses the video recording.
在一个示例中,请继续参考图4中的(d)图,视频录制界面中提供有抓拍选项46。在视频录制过程中,当用户想要抓拍某个视频帧时,可以触发抓拍选项46,响应于用户对抓拍选项46的触发操作,手机执行抓拍操作,并存储抓拍到的视频帧。In an example, please continue to refer to figure (d) in FIG. 4 , a snapshot option 46 is provided in the video recording interface. During the video recording process, when the user wants to capture a certain video frame, the capture option 46 can be triggered. In response to the trigger operation of the capture option 46 by the user, the mobile phone performs a capture operation and stores the captured video frame.
在一个示例中,请继续参考图4中的(d)图,视频录制界面中还提供有用于调焦的调焦项47。在视频录制过程中,当用户想要调焦时,可以触发调焦项47,譬如从1倍焦向长焦调整,比如调整至多倍焦(如2倍焦),或者从1倍焦向广角调整,比如调整至0.8倍焦。响应于用户对调焦项47的触发操作,手机对主摄像头进行调焦,或者切换至其他辅摄像头进行视频采集。譬如,当用户从1倍焦调整至n倍焦,n大于1且小于2时,手机对主摄像头进行调焦,当n大于或等于2时,手机从主摄像头切换至其他辅摄像头(比如切换至长焦摄像头)。再如,当用户从1倍焦向广角调整时,手机从主摄像头切换至广角摄像头。在本申请实施例中,无论是调焦前还是调焦后,均可以对当前进行视频录制的摄像头所采集的视频数据进行处理,以使得最终得到画面清晰的视频帧。In one example, please continue to refer to figure (d) in FIG. 4 , the video recording interface also provides a focusing item 47 for focusing. During the video recording process, when the user wants to focus, the focus adjustment item 47 can be triggered, such as adjusting from 1x focus to telephoto, such as adjusting to multi-fold focus (such as 2x focus), or from 1x focus to wide-angle Adjustment, such as adjusting to 0.8 times focus. In response to the user's trigger operation on the focusing item 47, the mobile phone focuses on the main camera, or switches to other auxiliary cameras for video collection. For example, when the user adjusts from 1x focus to nx focus, when n is greater than 1 and less than 2, the mobile phone will focus on the main camera, and when n is greater than or equal to 2, the mobile phone will switch from the main camera to other auxiliary cameras (such as switching to the telephoto camera). For another example, when the user adjusts from 1x focus to wide-angle, the mobile phone switches from the main camera to the wide-angle camera. In the embodiment of the present application, no matter before or after the focus adjustment, the video data collected by the camera currently performing video recording can be processed, so that a video frame with a clear picture can be finally obtained.
请参考图5,第一界面中提供有“更多”选项51。作为本申请的一个示例,当用户想要拍摄夜景视频时,可以触发“更多”选项51。响应于用户对“更多”选项51的触发操作,手机展示第三界面,譬如第三界面如图5中的(b)图所示。作为本申请的一个示例,在第三界面中提供有“夜景录像”选项52,“夜景录像”选项52用于触发夜景场景下的视频录制功能,也即相比于图4所示的示例,这里也可以单独设立一个用于拍摄夜景视频的选项。当用户想要通过手机录制夜景视频时可以触发“夜景录像”选项52。响应于用户对“夜景录像”选项52的触发操作,手机展示夜景模式下的操作界面(称为第四界面),示例性地,第四界面如图5中的(c)图所示。Please refer to FIG. 5 , there is a "more" option 51 in the first interface. As an example of the present application, when the user wants to shoot a night scene video, the "more" option 51 can be triggered. In response to the user's trigger operation on the "more" option 51, the mobile phone displays a third interface, for example, the third interface is shown in (b) of FIG. 5 . As an example of the present application, a "night scene recording" option 52 is provided in the third interface, and the "night scene recording" option 52 is used to trigger the video recording function under the night scene scene, that is, compared to the example shown in FIG. 4, Here you can also set up an option for shooting night scene videos separately. When the user wants to record the night scene video through the mobile phone, the option 52 of "night scene recording" can be triggered. In response to the user's trigger operation on the "night scene recording" option 52, the mobile phone displays an operation interface (called the fourth interface) in the night scene mode. Exemplarily, the fourth interface is shown in (c) in FIG. 5 .
在一个实施例中,第四界面中提供有拍摄选项53,用户可以触发拍摄选项53。响应于用户对拍摄选项53的触发操作,手机通过摄像头(如主摄像头)录制视频,譬如,视频录制界面如图5中的(d)图所示。另外,第四界面中还可以提供有第一切换选项54,第一切换选项54用于在前置摄像头和后置摄像头之间进行切换。与图4所示实施例不同的是,这里不需要在第四界面中提供第二切换选项,也即单独在“更多”选项 下提供用于触发夜景视频录制的“夜景录像”选项52。In one embodiment, a shooting option 53 is provided on the fourth interface, and the user can trigger the shooting option 53 . In response to the user's trigger operation on the shooting option 53, the mobile phone records a video through a camera (such as a main camera). For example, the video recording interface is shown in (d) in FIG. 5 . In addition, a first switching option 54 may also be provided in the fourth interface, and the first switching option 54 is used to switch between the front camera and the rear camera. Unlike the embodiment shown in Figure 4, there is no need to provide the second switching option in the fourth interface, that is, the "night scene recording" option 52 for triggering night scene video recording is provided under the "more" option alone.
当然需要说明的是,上述是以夜景拍摄为例进行说明,在另一个实施例中,本申请实施例提供的方法还可以应用于常规的视频录制场景,譬如可以参考图5中的(a)图,在用户通过“录像”选项触发电子设备执行视频录制后,电子设备仍可以采用本申请实施例提供的方法对采集的视频数据进行处理。在另一个实施例中,该方法还可以应用于相机预览场景,也即电子设备在启动相机进入预览状态时,可以采用本申请实施例提供的方法对预览图像进行处理。Of course, it should be noted that the above is described by taking night scene shooting as an example. In another embodiment, the method provided by the embodiment of the present application can also be applied to a conventional video recording scene. For example, refer to (a) in FIG. 5 As shown in the figure, after the user triggers the electronic device to perform video recording through the "recording" option, the electronic device can still process the collected video data by using the method provided by the embodiment of the present application. In another embodiment, the method can also be applied to a camera preview scene, that is, when the electronic device starts the camera and enters the preview state, it can use the method provided by the embodiment of the present application to process the preview image.
请参考图6,接下来结合图3所示的系统架构对本申请实施例提供的生成视频帧的方法实现流程进行详细介绍。作为示例而非限定,该方法应用于电子设备中,电子设备通过图3所示的各个节点之间的交互实现,该方法可以包括如下几个实现步骤:Please refer to FIG. 6 , and then describe in detail the implementation process of the method for generating video frames provided by the embodiment of the present application in combination with the system architecture shown in FIG. 3 . As an example but not a limitation, the method is applied to an electronic device, and the electronic device is implemented through the interaction between various nodes shown in FIG. 3. The method may include the following implementation steps:
601:图像感应器节点获取第一RAW数据。601: The image sensor node acquires first RAW data.
在实施中,电子设备启动相机应用。示例性地,如图4中的(a)图所示,电子设备的显示界面中提供有相机应用的应用图标。当检测到用户对应用图标的触发操作时,电子设备响应于用户的触发操作,启动相机应用。In an implementation, the electronic device launches a camera application. Exemplarily, as shown in (a) of FIG. 4 , an application icon of a camera application is provided on a display interface of the electronic device. When detecting a user's trigger operation on the application icon, the electronic device starts the camera application in response to the user's trigger operation.
在一个示例中,相机应用在检测到超夜视频模式下的视频拍摄的触发操作的情况下,确定接收到夜景视频拍摄指令。相机应用向视频模块下发夜景视频拍摄请求。示例性地,请参考图4实施例中的交互流程,电子设备在基于第二界面提供的第二切换选项检测到进入超夜视频模式后,若检测到用户对拍摄选项44的触发操作,则生成夜景视频拍摄请求,并向视频模块下发夜景视频拍摄请求。In an example, the camera application determines that a night scene video shooting instruction is received when a trigger operation of video shooting in the super night video mode is detected. The camera application sends a night scene video shooting request to the video module. Exemplarily, please refer to the interaction flow in the embodiment of FIG. Generate a night scene video shooting request, and send the night scene video shooting request to the video module.
视频模块接收夜景视频拍摄请求后,建立起用于处理夜景视频的框架,具体实现可以参见前文。之后,图像感应器节点通过摄像头中的图像感应器采集捕捉光源信号,并将捕捉到的光源信号转化为数据信号,得到第一RAW数据。示例性地,第一RAW数据为4K60的交错式高动态域(staggered high dynamic range,SHDR)数据,其中,4K60是指分辨率是4K、帧率是60帧/秒。After the video module receives the night scene video shooting request, it establishes a framework for processing the night scene video, and the specific implementation can be referred to above. Afterwards, the image sensor node collects and captures the light source signal through the image sensor in the camera, and converts the captured light source signal into a data signal to obtain the first RAW data. Exemplarily, the first RAW data is 4K60 interlaced high dynamic range (staggered high dynamic range, SHDR) data, where 4K60 means that the resolution is 4K and the frame rate is 60 frames per second.
在一个实施例中,第一RAW数据包括长曝光数据和短曝光数据,长曝光数据是指图像感应器通过长曝光方式采集的数据,短曝光数据是指图像感应器通过短曝光方式采集的数据。也即在一个曝光时长内进行两次曝光,以得到第一RAW数据。示例性地,以第一RAW数据为4K60的SHDR数据为例,摄像头在每个33ms内曝光两次,如此得到60帧的视频数据。In one embodiment, the first RAW data includes long exposure data and short exposure data, the long exposure data refers to the data collected by the image sensor through the long exposure method, and the short exposure data refers to the data collected by the image sensor through the short exposure method . That is, two exposures are performed within one exposure time to obtain the first RAW data. Exemplarily, taking the first RAW data as 4K60 SHDR data as an example, the camera exposes twice within each 33ms, thus obtaining 60 frames of video data.
值得一提的是,长短曝光结合,可以有效的提升视频帧的动态范围,高亮区域通过短曝光防止过曝,暗部区域通过长曝光提亮以防止欠曝光。It is worth mentioning that the combination of long and short exposures can effectively improve the dynamic range of the video frame. Short exposures are used to prevent overexposure in highlighted areas, and long exposures are used to brighten dark areas to prevent underexposure.
602:图像感应器节点向外置ISP节点发送第一RAW数据。602: The image sensor node sends the first RAW data to the external ISP node.
示例性地,图像感应器节点将4K60的SHDR数据发送给外置ISP节点,以通过外置ISP节点进行融合、增强等处理。Exemplarily, the image sensor node sends the 4K60 SHDR data to the external ISP node for processing such as fusion and enhancement through the external ISP node.
作为本申请的一个示例,第一RAW数据先到达外置ISP节点中的路由子模块。As an example of the present application, the first RAW data first arrives at the routing submodule in the external ISP node.
603:路由子模块对第一RAW数据进行复制、路由处理。603: The routing submodule performs copying and routing processing on the first RAW data.
电子设备在夜景场景中拍摄视频时,为了能够得到清晰的视频帧,一方面,可以对采集的第一RAW数据进行增强等处理,另一方面,可以根据摄像头采集的第一RAW 数据统计曝光数据,得到第一曝光数据,之后根据第一曝光数据动态调整摄像头的曝光参数。When an electronic device shoots a video in a night scene, in order to obtain a clear video frame, on the one hand, the first RAW data collected can be enhanced, and on the other hand, the exposure data can be calculated according to the first RAW data collected by the camera. , to obtain the first exposure data, and then dynamically adjust the exposure parameters of the camera according to the first exposure data.
为此,作为本申请的一个示例,由外置ISP节点中的路由子模块对第一RAW数据进行复制、路由处理。在实施中,路由子模块对第一RAW数据进行复制,为了便于区分,将经复制后得到的RAW数据称为第二RAW数据,如此可以得到两份RAW数据(包括第一RAW数据和第二RAW数据)。之后,将得到的两份RAW数据进行路由处理,具体地,路由子模块将其中一份RAW数据(譬如第一RAW数据)传输给第一预处理子模块进行处理,将另一份RAW数据(譬如第二RAW数据)用于后续内置ISP节点统计第一曝光数据。Therefore, as an example of the present application, the routing sub-module in the external ISP node performs copying and routing processing on the first RAW data. In implementation, the routing sub-module copies the first RAW data. For the convenience of distinction, the copied RAW data is called the second RAW data. In this way, two copies of RAW data (including the first RAW data and the second RAW data) can be obtained. RAW data). Afterwards, the two obtained RAW data are routed. Specifically, the routing submodule transmits one part of the RAW data (for example, the first RAW data) to the first preprocessing submodule for processing, and the other part of the RAW data ( For example, the second RAW data) is used for subsequent built-in ISP nodes to count the first exposure data.
604:第一预处理子模块对第一RAW数据进行预处理。604: The first preprocessing submodule performs preprocessing on the first RAW data.
由于受到摄像头的物理器件不理想等因素的影响,可能导致第一RAW数据存在一定的缺陷,譬如存在受到暗电流影响、图像周边的亮度衰减,以及存在坏点等问题,所以通常在对第一RAW数据进行融合和降噪处理之前,第一预处理子模块先对第一RAW数据进行预处理,以对第一RAW数据进行修正。Due to the influence of factors such as unsatisfactory physical components of the camera, there may be certain defects in the first RAW data, such as the influence of dark current, the brightness attenuation around the image, and the existence of dead pixels. Before performing fusion and noise reduction processing on the RAW data, the first preprocessing submodule first preprocesses the first RAW data, so as to correct the first RAW data.
作为示例而非限定,预处理包括但不限于镜头校正(lens shading correction,LSC)处理、黑电平补偿(black level compensation,BLC)处理、坏像素校正(bad pixel correction,BPC处理)、颜色插值处理中的至少一项。As an example and not limitation, preprocessing includes but is not limited to lens shading correction (LSC) processing, black level compensation (black level compensation, BLC) processing, bad pixel correction (bad pixel correction, BPC processing), color interpolation At least one of the processing.
605:第一预处理子模块将预处理后的第一RAW数据发送给增强子模块。605: The first preprocessing submodule sends the preprocessed first RAW data to the enhancement submodule.
譬如,第一预处理子模块将预处理后的4K60的SHDR数据发送给增强子模块。For example, the first preprocessing submodule sends the preprocessed 4K60 SHDR data to the enhancement submodule.
606:增强子模块对预处理后的第一RAW数据进行融合和降噪处理。606: The enhancement submodule performs fusion and noise reduction processing on the preprocessed first RAW data.
作为本申请的一个示例,对预处理后的第一RAW数据进行融合处理的具体实现可以包括:将预处理后的第一RAW数据输入至第一目标模型中进行处理,输出融合后的数据。第一目标模型能够基于任意的长曝光数据和短曝光数据确定融合数据。As an example of the present application, the specific implementation of performing fusion processing on the preprocessed first RAW data may include: inputting the preprocessed first RAW data into the first target model for processing, and outputting the fused data. The first target model can determine fusion data based on arbitrary long exposure data and short exposure data.
示例性地,若预处理后的第一RAW数据是4K60的SHDR数据,则将4K60的SHDR数据输入至第一目标模型中,经过融合处理后得到的数据是4K30数据。也即第一目标模型在做融合处理时,是将同一时间段内经连续两次曝光得到的长曝光数据和短曝光数据进行融合,所以对于融合前的60帧数据,经过融合处理后即变为30帧。Exemplarily, if the preprocessed first RAW data is 4K60 SHDR data, the 4K60 SHDR data is input into the first target model, and the data obtained after fusion processing is 4K30 data. That is to say, when the first target model performs fusion processing, it fuses the long-exposure data and short-exposure data obtained through two consecutive exposures in the same time period, so the 60-frame data before fusion becomes 30 frames.
其中,第一目标模型可以是预先训练好的融合网络模型。譬如第一目标模型可以是基于曝光样本数据对第一网络模型进行训练后得到的。在一个示例中,第一网络模型可以包括但不限于HDRnet。Wherein, the first target model may be a pre-trained fusion network model. For example, the first target model may be obtained after training the first network model based on the exposure sample data. In one example, the first network model may include, but is not limited to, HDRnet.
之后,对融合后得到的视频数据进行降噪处理。作为本申请的一个示例,对融合后得到的视频数据进行降噪处理的具体实现可以包括:将融合后得到的视频数数据输入至第二目标模型中进行处理,输出降噪后的视频数据。第二目标模型能够对任意的视频数据进行降噪处理。Afterwards, noise reduction processing is performed on the fused video data. As an example of the present application, the implementation of denoising the fused video data may include: inputting the fused video data into the second target model for processing, and outputting the denoised video data. The second target model can perform noise reduction processing on arbitrary video data.
其中,第二目标模型可以是预先训练好的降噪网络模型。譬如第二目标模型可以是基于RAW样本数据对第二网络模型进行训练后得到的。在一个示例中,第二网络模型可以包括但不限于Unet。Wherein, the second target model may be a pre-trained denoising network model. For example, the second target model may be obtained after training the second network model based on the RAW sample data. In one example, the second network model may include, but is not limited to, Unet.
607:增强子模块输出降噪处理后的视频数据,以及路由子模块输出第二RAW数据。607: The enhancement submodule outputs the video data after noise reduction processing, and the routing submodule outputs the second RAW data.
具体地,增强子模块将降噪处理后的视频数据发送给第二预处理子模块,以及路由子模块将第二RAW数据也发送给第二预处理子模块。不难理解,增强子模块输出的视频数据是4K30数据,用于浏览和记录;路由子模块输出的第二RAW数据是4K60数据,用于计算3A和可能的拍照需求。Specifically, the enhancement submodule sends the noise-reduced video data to the second preprocessing submodule, and the routing submodule also sends the second RAW data to the second preprocessing submodule. It is not difficult to understand that the video data output by the enhancement sub-module is 4K30 data, which is used for browsing and recording; the second RAW data output by the routing sub-module is 4K60 data, which is used for calculating 3A and possible camera needs.
需要说明的是,由于外置ISP节点对图像感应器采集的第一RAW数据进行了融合、降噪等处理,所以,外置ISP节点输出的视频数据与图像感应器输出的第一RAW数据之间一般会存在一定的时延。比如存在一帧的时延,举例来说,若图像感应器输出的是t时刻的第一RAW数据,则同时外置ISP节点输出的是t-1时刻的视频数据。It should be noted that since the external ISP node performs fusion and noise reduction processing on the first RAW data collected by the image sensor, the difference between the video data output by the external ISP node and the first RAW data output by the image sensor Generally, there will be a certain delay. For example, there is a delay of one frame. For example, if the image sensor outputs the first RAW data at time t, the external ISP node outputs video data at time t-1 at the same time.
另外,外置ISP节点控制增强子模块与路由子模块同步输出,也即降噪处理后的视频数据与第二RAW数据同步传输给第二预处理子模块。In addition, the external ISP node controls the synchronous output of the enhancement sub-module and the routing sub-module, that is, the noise-reduced video data and the second RAW data are synchronously transmitted to the second pre-processing sub-module.
608:第二预处理子模块对增强子模块输出的视频数据进行处理,以及基于第二RAW数据统计第一曝光数据,调整曝光参数。608: The second preprocessing submodule processes the video data output by the enhancement submodule, and calculates the first exposure data based on the second RAW data, and adjusts an exposure parameter.
作为本申请的一个示例,第二预处理子模块对增强子模块输出的视频数据的处理包括:对增强子模块输出的视频数据再次进行预处理,譬如可以包括但不限于LSC处理、BLC处理、BPC处理、颜色插值处理中的至少一项,以进一步减小视频数据的噪声。之后,将经过再次预处理后的视频数据进行RGB转换,并对RGB转换后得到的视频图像进行压缩处理,得到YUV图像。As an example of the present application, the processing of the video data output by the enhancement submodule by the second preprocessing submodule includes: performing preprocessing again on the video data output by the enhancement submodule, such as but not limited to LSC processing, BLC processing, At least one of BPC processing and color interpolation processing to further reduce the noise of the video data. Afterwards, RGB conversion is performed on the preprocessed video data again, and the video image obtained after the RGB conversion is compressed to obtain a YUV image.
需要说明的是,本申请实施例中所述的第二预处理子模块再次对增强子模块输出的视频数据进行预处理是可选的,在另一个实施例中,第二预处理子模块也可以直接基于增强子模块输出的视频数据进行RGB转换,本申请实施例对此不作限定。It should be noted that it is optional for the second preprocessing submodule described in the embodiment of the present application to preprocess the video data output by the enhancement submodule again. In another embodiment, the second preprocessing submodule also The RGB conversion may be performed directly based on the video data output by the enhancement sub-module, which is not limited in this embodiment of the present application.
另外,第二预处理子模块基于所接收的第二RAW数据确定第一曝光数据,并根据第一曝光数据确定当前的曝光程度是否合理,若不合理,再去调整摄像头的曝光参数。其中第一曝光数据的取值范围是(0,255)。在一个示例中,第二预处理子模块将第一曝光数据与曝光阈值进行比较,若第一曝光数据与曝光阈值之间的差值大于阈值范围,则按照一定的调整步长逐渐调整第一曝光数据,得到目标曝光数据。第二预处理子模块将目标曝光数据发送给摄像头,以使得摄像头调整图像感应器的曝光参数,最终的目的是使得根据第二RAW数据统计的曝光数据与曝光阈值接近或相同。In addition, the second preprocessing sub-module determines the first exposure data based on the received second RAW data, and determines whether the current exposure level is reasonable according to the first exposure data, and then adjusts the exposure parameters of the camera if it is not reasonable. The value range of the first exposure data is (0, 255). In one example, the second preprocessing submodule compares the first exposure data with the exposure threshold, and if the difference between the first exposure data and the exposure threshold is greater than the threshold range, gradually adjusts the first Exposure data to obtain target exposure data. The second preprocessing sub-module sends the target exposure data to the camera, so that the camera adjusts the exposure parameters of the image sensor, and the ultimate goal is to make the exposure data calculated according to the second RAW data close to or equal to the exposure threshold.
其中,调整步长可以根据实际需求进行设置。曝光阈值可以根据实际需求进行设置。阈值范围也可以根据实际需求进行设置。Wherein, the adjustment step size may be set according to actual requirements. The exposure threshold can be set according to actual needs. The threshold range can also be set according to actual needs.
譬如,曝光阈值为128,阈值范围为[0,5],调整步长为4。若第一曝光数据为86,说明需要提高曝光参数,此时可以按照调整步长调整第一曝光数据,得到目标曝光数据为90。第二预处理子模块将目标曝光数据90发送给摄像头,以使摄像头将图像感应器的曝光参数调整为90。并再次根据下次接收的第二RAW数据统计曝光数据,按照上述方法调整图像感应器的曝光参数,直到统计的曝光数据接近或等于128为止。For example, the exposure threshold is 128, the threshold range is [0,5], and the adjustment step is 4. If the first exposure data is 86, it means that the exposure parameter needs to be increased. At this time, the first exposure data can be adjusted according to the adjustment step to obtain a target exposure data of 90. The second preprocessing sub-module sends the target exposure data 90 to the camera, so that the camera adjusts the exposure parameter of the image sensor to 90. The exposure data is again counted according to the second RAW data received next time, and the exposure parameters of the image sensor are adjusted according to the above method until the counted exposure data is close to or equal to 128.
值得一提的是,通过逐步调整曝光数据的方式使得摄像头的曝光参数与曝光阈值相接近或相同,可以使得视频帧的曝光变化平滑过度。It is worth mentioning that by adjusting the exposure data step by step so that the exposure parameters of the camera are close to or the same as the exposure threshold, the exposure changes of the video frames can be smoothly transitioned.
609:第二预处理子模块向优化处理子模块发送YUV图像和目标曝光数据。609: The second preprocessing submodule sends the YUV image and target exposure data to the optimization processing submodule.
根据前文所述可知,目标曝光数据是根据第一曝光数据确定的调整后的曝光数据。譬如,若第一曝光数据是100,第二预处理子模块确定需要将图像感应器的曝光参数 调整至200,则目标曝光数据是200。According to the foregoing, it can be seen that the target exposure data is the adjusted exposure data determined according to the first exposure data. For example, if the first exposure data is 100, and the second preprocessing sub-module determines that the exposure parameter of the image sensor needs to be adjusted to 200, then the target exposure data is 200.
作为本申请的一个示例,由于第二预处理子模块对图像感应器的曝光参数进行了调整,所以后续通过图像感应器获得的视频数据的增益发生了变化,为了能够便于优化处理子模块对下一次接收到的YUV图像进行合理的降噪处理,第二预处理子模块在调整图像感应器的曝光参数的同时,将目标曝光数据发送给优化处理子模块,便于优化处理子模块确定降噪参数,从而根据降噪参数对下一次接收到YUV图像进行合理的降噪处理。As an example of the present application, since the second preprocessing sub-module adjusts the exposure parameters of the image sensor, the gain of the video data obtained through the image sensor subsequently changes. In order to facilitate the optimization processing sub-module The YUV image received once is subjected to reasonable noise reduction processing. While adjusting the exposure parameters of the image sensor, the second preprocessing sub-module sends the target exposure data to the optimization processing sub-module, which is convenient for the optimization processing sub-module to determine the noise reduction parameters. , so as to perform reasonable noise reduction processing on the next received YUV image according to the noise reduction parameters.
作为本申请的一个示例,外置ISP节点中包括多个第二目标模型,多个第二目标模型中的每个第二目标模型对应有曝光数值范围,每个第二目标模型对应的曝光数值范围的数量可以为一个或者多个。根据前文所述可知,第二目标模型能够用于降噪处理,同理,为了能够对下一次的视频数据进行合理的降噪处理,第二预处理子模块还可以将目标曝光数据发送给外置ISP节点,以便于外置ISP节点确定第二预处理子模块反馈的目标曝光数据所属的曝光数值范围,从而根据所确定的曝光数值范围,从多个第二目标模型中选择对应的第二目标模型,选择的第二目标模型用于下一次的降噪处理。As an example of this application, the external ISP node includes multiple second target models, each of the multiple second target models corresponds to an exposure value range, and the exposure value corresponding to each second target model The number of ranges can be one or more. According to the foregoing, it can be seen that the second target model can be used for noise reduction processing. Similarly, in order to perform reasonable noise reduction processing on the next video data, the second preprocessing sub-module can also send the target exposure data to external Set the ISP node so that the external ISP node can determine the exposure value range to which the target exposure data fed back by the second preprocessing sub-module belongs, so that according to the determined exposure value range, the corresponding second target model can be selected from multiple second target models. The target model, the selected second target model is used for the next noise reduction process.
610:优化处理子模块基于接收的数据进行图像优化处理。610: The optimization processing submodule performs image optimization processing based on the received data.
优化处理子模块根据目标曝光数据对YUV图像进行优化,譬如对YUV图像进行降噪处理,从而得到画面清晰、明朗的视频帧。The optimization processing sub-module optimizes the YUV image according to the target exposure data, such as performing noise reduction processing on the YUV image, so as to obtain a clear and bright video frame.
611:优化处理子模块将得到的视频帧送显。611: The optimization processing submodule sends the obtained video frames to display.
也即,优化处理子模块将图像优化处理后得到的视频帧发送给显示屏进行显示。That is, the optimization processing sub-module sends the video frames obtained after the image optimization processing to the display screen for display.
需要说明的是,上述是以第二预处理子模块接收第二RAW数据后统计第一曝光数据,调整图像感应器的曝光参数为例进行说明。在实施中,第二预处理子模块还基于第二RAW数据统计AWB和AF,并将AWB发送给优化处理子模块,以便于优化处理子模块在图像优化处理过程中进行白平衡调整。另外第二预处理子模块将AF发送给摄像头,以便于摄像头根据AF进行调整处理。It should be noted that, the above is described by taking the second preprocessing sub-module to count the first exposure data after receiving the second RAW data, and adjust the exposure parameters of the image sensor as an example. In implementation, the second preprocessing submodule also counts the AWB and AF based on the second RAW data, and sends the AWB to the optimization processing submodule, so that the optimization processing submodule can perform white balance adjustment during image optimization processing. In addition, the second preprocessing submodule sends the AF to the camera, so that the camera can perform adjustment processing according to the AF.
在本申请实施例中,在超夜视频模式下,通过外置ISP对视频数据进行融合和降噪处理,将处理后的视频数据发送给内置ISP,并为内置ISP提供原始的视频数据,以便于内置ISP可以根据原始的视频数据确定目标曝光数据。如此,内置ISP即可基于外置ISP提供的处理后的视频数据和确定的目标曝光数据,生成画面清晰的视频帧。In the embodiment of this application, in the super night video mode, the video data is fused and denoised through the external ISP, the processed video data is sent to the built-in ISP, and the original video data is provided for the built-in ISP, so that Because the built-in ISP can determine the target exposure data based on the original video data. In this way, the built-in ISP can generate clear video frames based on the processed video data provided by the external ISP and the determined target exposure data.
请参考图7,图7是根据一示例性实施例示出的一种硬件的结构示意图,本申请实施例涉及的硬件主要包括摄像头、外置ISP和内置ISP。其中外置ISP内部包括多个接口、路由单元、前端处理单元以及后端处理单元,路由单元与前端处理单元相连接,前端处理单元与后端处理单元相连接,路由单元用于执行图6实施例中路由子模块的功能,前端处理单元用于执行图6实施例中第一预处理子模块的功能,后端处理单元用于执行图6中增强子模块的功能,在一个示例中,前端处理单元包括IFE,后端处理单元包括NPU;内置ISP内部包括第一ISP前端单元、第二ISP前端单元以及ISP后端单元,第一ISP前端单元与ISP后端单元相连接,第二ISP前端单元与ISP后端单元相连接,第一ISP前端单元和第二ISP前端单元用于执行图6中第二预处理子模 块的功能,ISP后端单元用于执行图6中优化处理子模块的功能。在一个示例中,第一ISP前端单元包括IFE0,第二ISP前端单元包括IFE1,ISP后端单元包括IPE。Please refer to FIG. 7 . FIG. 7 is a schematic structural diagram of hardware according to an exemplary embodiment. The hardware involved in this embodiment of the present application mainly includes a camera, an external ISP, and a built-in ISP. The external ISP includes multiple interfaces, a routing unit, a front-end processing unit, and a back-end processing unit. The routing unit is connected to the front-end processing unit, and the front-end processing unit is connected to the back-end processing unit. The routing unit is used to execute the implementation shown in Figure 6. In the function of the routing submodule in the example, the front-end processing unit is used to perform the function of the first preprocessing submodule in the embodiment of FIG. 6 , and the back-end processing unit is used to perform the function of the enhanced submodule in FIG. 6 . The processing unit includes an IFE, and the back-end processing unit includes an NPU; the built-in ISP includes a first ISP front-end unit, a second ISP front-end unit, and an ISP back-end unit, the first ISP front-end unit is connected to the ISP back-end unit, and the second ISP front-end unit The unit is connected with the ISP back-end unit, and the first ISP front-end unit and the second ISP front-end unit are used to perform the function of the second preprocessing submodule in Figure 6, and the ISP back-end unit is used to perform the optimization processing submodule in Figure 6 Function. In one example, the first ISP front-end unit includes IFE0, the second ISP front-end unit includes IFE1, and the ISP back-end unit includes IPE.
需要说明的是,上述仅是示例性的示出了外置ISP和内置ISP内部包括的多个单元,但并不对其结构的组成部分构成限定。在一些实施例中,外置ISP或内置ISP的内部还可能包括其他单元,本申请实施例对此不作限定。It should be noted that, the foregoing is only an exemplary illustration of the multiple units included in the external ISP and the internal ISP, but does not constitute a limitation to the structural components thereof. In some embodiments, the external ISP or the internal ISP may further include other units, which is not limited in this embodiment of the present application.
接下来结合附图7所示的硬件框架图,对本申请实施例提供的生成视频帧的方法流程进行介绍,具体地:Next, in conjunction with the hardware framework diagram shown in accompanying drawing 7, the flow of the method for generating video frames provided by the embodiment of the present application is introduced, specifically:
701:外置ISP接收来自摄像头的第一RAW数据。701: The external ISP receives the first RAW data from the camera.
在一个实施例中,第一RAW数据可能是来自电子设备的主摄像头。在另一个实施例中,第一RAW数据也可能是来自电子设备的辅摄像头。比如在1倍焦的情况下,第一RAW数据来自电子设备的主摄像头,再如在3倍焦的情况下,第一RAW数据来自电子设备的辅摄像头,本申请实施例对此不做限定。In one embodiment, the first RAW data may be from the main camera of the electronic device. In another embodiment, the first RAW data may also be from an auxiliary camera of the electronic device. For example, in the case of 1x focus, the first RAW data comes from the main camera of the electronic device, and in the case of 3x focus, the first RAW data comes from the auxiliary camera of the electronic device, which is not limited in this embodiment of the present application .
作为示例而非限定,如图7所示,外置ISP通过移动行业处理器接口(mobile industry processor interface,Mipi)0接收来自摄像头的第一RAW数据。As an example but not a limitation, as shown in FIG. 7, the external ISP receives the first RAW data from the camera through a mobile industry processor interface (mobile industry processor interface, Mipi)0.
702:外置ISP通过路由单元对第一RAW数据进行复制、路由处理。702: The external ISP copies and routes the first RAW data through the routing unit.
作为本申请的一个示例,外置ISP首先通过路由单元对第一RAW数据进行复制,如此可以得到另一份RAW数据,这里将其称为第二RAW数据。之后,路由单元对这两份RAW数据进行路由处理,示例性地,将其中一份RAW数据(譬如第一RAW数据)传输给外置ISP中的前端处理单元,由前端处理单元基于这一份第一RAW数据进行预处理,并将预处理后得到的第一RAW数据发送给外置ISP中的后端处理单元,由后端处理单元进行融合和降噪处理;另一份RAW数据(譬如第二RAW数据)用于直接输出给内置ISP。As an example of the present application, the external ISP first copies the first RAW data through the routing unit, so as to obtain another copy of the RAW data, which is referred to as the second RAW data here. Afterwards, the routing unit performs routing processing on the two sets of RAW data. For example, one of the RAW data (such as the first RAW data) is transmitted to the front-end processing unit in the external ISP, and the front-end processing unit is based on this one. The first RAW data is preprocessed, and the first RAW data obtained after preprocessing is sent to the back-end processing unit in the external ISP, and the back-end processing unit performs fusion and noise reduction processing; another RAW data (such as 2nd RAW data) for direct output to the built-in ISP.
其中前端处理单元对RAW数据的预处理可以参见上述图6所示实施例,后端处理单元对预处理后的RAW数据的融合和降噪处理也可以参见上述图6所示实施例。The preprocessing of the RAW data by the front-end processing unit may refer to the embodiment shown in FIG. 6 above, and the fusion and noise reduction processing of the preprocessed RAW data by the back-end processing unit may also refer to the embodiment shown in FIG. 6 above.
需要说明的是,上述仅是以将第一RAW数据传输给外置ISP中的前端处理单元以及将第二RAW数据直接输出给内置ISP为例进行说明。在另一实施例中,也可以将第二RAW数据传输给外置ISP中的前端处理单元,以及将第一RAW数据直接输出给内置ISP,本申请实施例对此不作限定。It should be noted that, the above is only described by taking the example of transmitting the first RAW data to the front-end processing unit in the external ISP and directly outputting the second RAW data to the built-in ISP. In another embodiment, the second RAW data may also be transmitted to the front-end processing unit in the external ISP, and the first RAW data may be directly output to the built-in ISP, which is not limited in this embodiment of the present application.
703:后端处理单元输出降噪处理后的视频数据,以及路由单元输出第二RAW数据。703: The back-end processing unit outputs the video data after the noise reduction processing, and the routing unit outputs the second RAW data.
示例性地,后端处理单元通过外置ISP的Mipi0接口,将降噪处理后的视频数据发送给内置ISP,路由单元通过外置ISP的Mipi1接口将另一份60帧的第二RAW数据发送给内置ISP。Exemplarily, the back-end processing unit sends the noise-reduced video data to the built-in ISP through the Mipi0 interface of the external ISP, and the routing unit sends another 60-frame second RAW data through the Mipi1 interface of the external ISP to the built-in ISP.
704:内置ISP接收后端处理单元输出的视频数据,以及路由单元输出的第二RAW数据。704: The built-in ISP receives the video data output by the back-end processing unit and the second RAW data output by the routing unit.
在一个示例中,内置ISP通过第一ISP前端单元接收后端处理单元输出的视频数据,然后由第一ISP前端单元对后端处理单元输出的视频数据进行处理,譬如进行RGB转换,并将转换后的RGB图像进行压缩,得到YUV图像。在一些实施例中,第一ISP前端单元在进行数据格式转换之前,还可以对所接收的视频数据进行预处理,譬如预 处理包括但不限于颜色校正、下采样、去马赛克等。In one example, the built-in ISP receives the video data output by the back-end processing unit through the first ISP front-end unit, and then the first ISP front-end unit processes the video data output by the back-end processing unit, such as RGB conversion, and converts The final RGB image is compressed to obtain a YUV image. In some embodiments, the first ISP front-end unit may also perform preprocessing on the received video data before performing data format conversion. For example, preprocessing includes but is not limited to color correction, downsampling, demosaicing, etc.
之后,第一ISP前端单元将YUV图像传输给ISP后端单元进行处理。在一个示例中,ISP后端单元主要用于诸如硬件降噪、图像的裁剪、降噪、颜色处理、细节增强等图像处理工作,示例性地,硬件降噪包括多帧降噪(multi-frame noise reduction,MFNR)、多帧超分辨率(multi-frame super resolution,MFSR)。Afterwards, the first ISP front-end unit transmits the YUV image to the ISP back-end unit for processing. In one example, the ISP back-end unit is mainly used for image processing tasks such as hardware noise reduction, image cropping, noise reduction, color processing, detail enhancement, etc. Exemplarily, hardware noise reduction includes multi-frame noise reduction (multi-frame noise reduction, MFNR), multi-frame super resolution (multi-frame super resolution, MFSR).
在一个示例中,内置ISP通过第二ISP前端单元接收路由单元输出的第二RAW数据。第二ISP前端单元在接收到第二RAW数据后,基于第二RAW数据确定第一曝光数据,并根据第一曝光数据确定当前的曝光程度是否合理,若不合理,确定目标曝光数据,并根据目标曝光数据去调整摄像头的曝光参数。示例性地,第二ISP前端单元通过I2C接口将目标曝光数据发送给摄像头,以对摄像头进行控制。其具体实现可以参见图6所示实施例。In an example, the built-in ISP receives the second RAW data output by the routing unit through the second ISP front-end unit. After receiving the second RAW data, the second ISP front-end unit determines the first exposure data based on the second RAW data, and determines whether the current exposure degree is reasonable according to the first exposure data, and if not, determines the target exposure data, and according to The target exposure data is used to adjust the exposure parameters of the camera. Exemplarily, the second ISP front-end unit sends the target exposure data to the camera through the I2C interface, so as to control the camera. For its specific implementation, reference may be made to the embodiment shown in FIG. 6 .
进一步地,第二ISP前端单元还基于第二RAW数据统计AF,并通过I2C接口将AF发送给摄像头,以便于摄像头根据AF进行调整处理。Further, the second ISP front-end unit also counts the AF based on the second RAW data, and sends the AF to the camera through the I2C interface, so that the camera can perform adjustment processing according to the AF.
除此之外,第二ISP前端单元还基于第二RAW数据统计AWB、颜色等数据。第二ISP前端单元将3A、颜色等数据传输给ISP后端单元,以便于ISP后端单元根据第二ISP前端单元传输的数据对YUV图像进行优化,譬如对YUV图像进行降噪处理,从而得到画面清晰、明朗的视频帧。In addition, the second ISP front-end unit also counts AWB, color and other data based on the second RAW data. The second ISP front-end unit transmits data such as 3A and color to the ISP back-end unit, so that the ISP back-end unit can optimize the YUV image according to the data transmitted by the second ISP front-end unit, such as performing noise reduction processing on the YUV image, thereby obtaining Clear, crisp video frames.
此外,第二ISP前端单元还可以通过外设接口,将目标曝光数据发送给外置ISP,以便于外置ISP根据目标曝光数据,从多个用于降噪处理的第二目标模型中选择一个第二目标模型,从而根据选择的第二目标模型,对下一次的视频数据进行降噪处理。示例性地,外设接口可以为安全数据输入和输出(secure digital input and output,SDIO)接口。In addition, the second ISP front-end unit can also send the target exposure data to the external ISP through the peripheral interface, so that the external ISP can select one of multiple second target models for noise reduction according to the target exposure data. The second target model, so that the next video data is subjected to noise reduction processing according to the selected second target model. Exemplarily, the peripheral interface may be a secure digital input and output (secure digital input and output, SDIO) interface.
705:内置ISP输出视频帧。705: Built-in ISP output video frame.
具体地,内置ISP通过ISP后端单元输出视频帧,以将视频帧显示在显示屏上。Specifically, the built-in ISP outputs the video frame through the ISP back-end unit, so as to display the video frame on the display screen.
请参考图8,图8是根据一示例性实施例示出的一种生成视频帧的方法流程的示意图。作为示例而非限定,该方法可以应用于上述电子设备中,电子设备包括图像感应器、第一图像信号处理模块以及第二图像信号处理模块。第二图像信号处理模块是具有视频数据处理功能的模块,第一图像信号处理模块是能够获取视频数据且具有视频数据处理功能的模块。作为本申请的一个示例,第二图像信号处理模块包括SOC中集成的ISP,也即包括上述内置ISP,第一图像信号处理模块包括SOC外部的ISP,也即包括上述外置ISP。电子设备通过图像感应器、第一图像信号处理模块和第二图像信号处理模块实现生成视频帧的方法,该方法可以包括如下内容:Please refer to FIG. 8 . FIG. 8 is a schematic diagram showing a flow of a method for generating video frames according to an exemplary embodiment. As an example but not a limitation, the method may be applied to the above-mentioned electronic device, and the electronic device includes an image sensor, a first image signal processing module, and a second image signal processing module. The second image signal processing module is a module with a video data processing function, and the first image signal processing module is a module capable of acquiring video data and having a video data processing function. As an example of the present application, the second image signal processing module includes an ISP integrated in the SOC, that is, includes the above-mentioned built-in ISP, and the first image signal processing module includes an ISP outside the SOC, that is, includes the above-mentioned external ISP. The electronic device implements a method for generating a video frame through an image sensor, a first image signal processing module, and a second image signal processing module, and the method may include the following:
步骤801:图像感应器输出第一RAW数据。Step 801: The image sensor outputs first RAW data.
譬如请参考图6所示实施例中的步骤601,第一RAW数据是图像感应器获取的原始的RAW数据,也即第一RAW数据为原始视频数据。For example, please refer to step 601 in the embodiment shown in FIG. 6 , the first RAW data is the original RAW data acquired by the image sensor, that is, the first RAW data is the original video data.
在一个示例中,步骤801的具体实现可以包括:通过电子设备中的相机应用检测到夜景视频拍摄指令,夜景视频拍摄指令用于指示在夜景模式下进行视频录制。响应于夜景视频拍摄指令,图像感应器输出第一RAW数据。In an example, the specific implementation of step 801 may include: detecting a night scene video shooting instruction through a camera application in the electronic device, where the night scene video shooting instruction is used to instruct video recording in a night scene mode. In response to the night scene video shooting instruction, the image sensor outputs first RAW data.
步骤802:第一图像信号处理模块获取第一RAW数据。Step 802: the first image signal processing module acquires first RAW data.
步骤803:第一图像信号处理模块复制第一RAW数据,得到第二RAW数据。Step 803: the first image signal processing module copies the first RAW data to obtain the second RAW data.
示例性地,请参考图6所示实施例中的步骤603,第二RAW数据可以是由路由子模块对RAW数据进行复制后得到的另一份RAW数据。For example, please refer to step 603 in the embodiment shown in FIG. 6 , the second RAW data may be another copy of RAW data obtained by copying the RAW data by the routing submodule.
步骤804:第一图像信号处理模块对第一RAW数据进行图像增强处理,得到视频增强数据。Step 804: The first image signal processing module performs image enhancement processing on the first RAW data to obtain video enhancement data.
作为本申请的一个示例,第一RAW数据包括同一时间段内采集的长曝光数据和短曝光数据。在该种情况下,步骤804的具体实现可以包括:第一图像信号处理模块将长曝光数据和短曝光数据进行融合处理,得到融合RAW数据。第一图像信号处理模块对融合RAW数据进行降噪处理,得到视频增强数据。As an example of the present application, the first RAW data includes long exposure data and short exposure data collected in the same time period. In this case, the specific implementation of step 804 may include: the first image signal processing module fuses the long-exposure data and the short-exposure data to obtain fused RAW data. The first image signal processing module performs noise reduction processing on the fused RAW data to obtain video enhancement data.
作为本申请的一个示例,第一图像信号处理模块将长曝光数据和短曝光数据进行融合处理的具体实现可以包括:第一图像信号处理模块将长曝光数据和短曝光数据输入至第一目标模型中,由第一目标模型进行融合处理,第一目标模型能够对任意的长曝光和短曝光数据进行融合处理。As an example of the present application, the specific implementation of the fusion processing of the long exposure data and the short exposure data by the first image signal processing module may include: the first image signal processing module inputs the long exposure data and the short exposure data into the first object model In the method, fusion processing is performed by the first object model, and the first object model can perform fusion processing on arbitrary long exposure and short exposure data.
作为本申请的一个示例,第一图像信号处理模块将长曝光数据和短曝光数据进行融合处理,得到融合RAW数据之前,还包括:第一图像信号处理模块对长曝光数据和短曝光数据进行预处理,预处理包括LSC处理、BLC处理、BPC处理、颜色插值处理中的至少一项。该种情况下,第一图像信号处理模块将长曝光数据和短曝光数据进行融合处理的具体实现包括:第一图像信号处理模块将预处理后的长曝光数据和短曝光数据进行融合处理,得到融合RAW数据。As an example of the present application, the first image signal processing module fuses the long exposure data and the short exposure data, and before obtaining the fused RAW data, it also includes: the first image signal processing module performs preprocessing Processing, the preprocessing includes at least one of LSC processing, BLC processing, BPC processing, and color interpolation processing. In this case, the specific implementation of the fusion processing of the long exposure data and the short exposure data by the first image signal processing module includes: the first image signal processing module performs fusion processing on the preprocessed long exposure data and short exposure data to obtain Fusion of RAW data.
作为本申请的一个示例,第一图像信号处理模块对融合RAW数据进行降噪处理的具体实现可以包括:第一图像信号处理模块将融合RAW数据输入至第二目标模型中,由第二目标模型进行降噪处理,第二目标模型能够对任意的RAW数据进行降噪处理。As an example of the present application, the specific implementation of the first image signal processing module to perform noise reduction processing on the fused RAW data may include: the first image signal processing module inputs the fused RAW data into the second target model, and the second target model Perform noise reduction processing, and the second target model can perform noise reduction processing on any RAW data.
作为本申请的一个示例,第一图像信号处理模块中包括多个第二目标模型,多个第二目标模型中的每个第二目标模型对应有曝光数值范围。在该种情况下,第一图像信号处理模块将融合RAW数据输入至第二目标模型中之前,还包括:第一图像信号处理模块接收目标曝光数据,目标曝光数据是由第二图像信号处理模块基于第一曝光数据确定,第一曝光数据是由第二图像信号处理模块基于第二RAW数据进行曝光数据统计得到,目标曝光数据用于调整电子设备的图像感应器的曝光参数。第一图像信号处理模块根据目标曝光数据、以及每个第二目标模型对应的曝光数值范围,从多个第二目标模型中选择一个第二目标模型,选择的第二目标模型用于降噪处理。As an example of the present application, the first image signal processing module includes a plurality of second target models, and each second target model in the plurality of second target models corresponds to an exposure value range. In this case, before the first image signal processing module inputs the fused RAW data into the second target model, it further includes: the first image signal processing module receives target exposure data, and the target exposure data is generated by the second image signal processing module Determined based on the first exposure data, the first exposure data is obtained by the second image signal processing module based on the second RAW data to perform statistics on the exposure data, and the target exposure data is used to adjust the exposure parameters of the image sensor of the electronic device. The first image signal processing module selects a second target model from multiple second target models according to the target exposure data and the exposure value range corresponding to each second target model, and the selected second target model is used for noise reduction processing .
示例性地,请参考图6所示的实施例,上述预处理过程由第一预处理子模块执行,融合和降噪处理过程由增强子模块执行。该种情况下,视频增强数据是指由增强子模块输出的视频数据,第二RAW数据是指由路由子模块输出的视频数据。For example, please refer to the embodiment shown in FIG. 6 , the above preprocessing process is performed by the first preprocessing submodule, and the fusion and noise reduction processing processes are performed by the enhancement submodule. In this case, the video enhancement data refers to the video data output by the enhancement sub-module, and the second RAW data refers to the video data output by the routing sub-module.
步骤805:第一图像信号处理模块将视频增强数据以及第二RAW数据发送给第二图像信号处理模块。Step 805: The first image signal processing module sends the video enhancement data and the second RAW data to the second image signal processing module.
示例性地,请参考图6所示实施例,第一图像信号处理模块分别将视频增强数据和第二RAW数据发送给第二预处理子模块。For example, referring to the embodiment shown in FIG. 6 , the first image signal processing module sends the video enhancement data and the second RAW data to the second preprocessing submodule respectively.
步骤806:第二图像信号处理模块基于视频增强数据和第二RAW数据,生成视频帧。Step 806: The second image signal processing module generates a video frame based on the video enhancement data and the second RAW data.
在一个示例中,步骤806的具体实现包括:第二图像信号处理模块对视频增强数据进行格式转换处理,得到YUV图像。第二图像信号处理模块基于第二RAW数据,确定目标数据,目标数据用于调整YUV图像的图像质量。第二图像信号处理模块基于目标数据调整YUV图像,并将调整后的YUV图像作为视频帧。In an example, the specific implementation of step 806 includes: the second image signal processing module performs format conversion processing on the video enhancement data to obtain a YUV image. The second image signal processing module determines target data based on the second RAW data, and the target data is used to adjust the image quality of the YUV image. The second image signal processing module adjusts the YUV image based on the target data, and uses the adjusted YUV image as a video frame.
在一个示例中,目标数据包括但不限于3A数据、颜色。In one example, target data includes but not limited to 3A data, color.
在本申请实施例中,由第一图像信号处理模块获取第一RAW数据,复制第一RAW数据,得到第二RAW数据。基于第一RAW数据进行图像增强处理,得到视频增强数据。将视频增强数据和第二RAW数据发送给第二图像信号处理模块。第二图像信号处理模块基于视频增强数据和第二RAW数据生成视频帧。也即通过第一图像信号处理模块进行图像增强处理,且第一图像信号处理模块为第二图像信号处理模块还提供了可以用于调整曝光参数的第二RAW数据,如此可以保证能够得到清晰的视频帧。In the embodiment of the present application, the first RAW data is acquired by the first image signal processing module, and the first RAW data is copied to obtain the second RAW data. Image enhancement processing is performed based on the first RAW data to obtain video enhancement data. Send the enhanced video data and the second RAW data to the second image signal processing module. The second image signal processing module generates video frames based on the video enhancement data and the second RAW data. That is, image enhancement processing is performed by the first image signal processing module, and the first image signal processing module also provides the second image signal processing module with second RAW data that can be used to adjust the exposure parameters, so as to ensure that clear video frame.
应理解,上述实施例中各步骤的序号并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned functions can be assigned to different functional units, Completion of modules means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit, and the above-mentioned integrated units may adopt hardware It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above system, reference may be made to the corresponding processes in the aforementioned method embodiments, and details will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the system embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显 示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到电子设备的任何实体或装置、记录介质、计算机存储器、只读存储器(Read-Only Memory,ROM)、RAM、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the procedures in the methods of the above embodiments in the present application can be completed by instructing related hardware through computer programs, and the computer programs can be stored in a computer-readable storage medium. The computer program When executed by a processor, the steps in the above-mentioned various method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program codes to electronic equipment, recording media, computer memory, read-only memory (Read-Only Memory, ROM), RAM, electrical carrier signal, telecommunications signals and software distribution media. Such as U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunication signals under legislation and patent practice.
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。Finally, it should be noted that: the above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application shall be covered by this application. within the scope of the application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (12)

  1. 一种生成视频帧的方法,其特征在于,应用于电子设备,所述电子设备包括图像感应器、第一图像信号处理模块以及第二图像信号处理模块,所述方法包括:A method for generating a video frame, characterized in that it is applied to an electronic device, the electronic device includes an image sensor, a first image signal processing module, and a second image signal processing module, and the method includes:
    所述图像感应器输出第一原始数据;The image sensor outputs first raw data;
    所述第一图像信号处理模块获取所述第一原始数据;The first image signal processing module acquires the first raw data;
    所述第一图像信号处理模块复制所述第一原始数据,得到第二原始数据;The first image signal processing module copies the first original data to obtain second original data;
    所述第一图像信号处理模块对所述第一原始数据进行图像增强处理,得到视频增强数据;The first image signal processing module performs image enhancement processing on the first raw data to obtain video enhancement data;
    所述第一图像信号处理模块将所述视频增强数据以及所述第二原始数据发送给所述第二图像信号处理模块;The first image signal processing module sends the video enhancement data and the second original data to the second image signal processing module;
    所述第二图像信号处理模块基于所述视频增强数据和所述第二原始数据,生成视频帧。The second image signal processing module generates video frames based on the video enhancement data and the second original data.
  2. 根据权利要求1所述的方法,其特征在于,所述第一原始数据包括同一时间段内采集的长曝光数据和短曝光数据,所述第一图像信号处理模块对所述第一原始数据进行图像增强处理,包括:The method according to claim 1, wherein the first raw data includes long exposure data and short exposure data collected in the same time period, and the first image signal processing module performs processing on the first raw data Image enhancement processing, including:
    所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据进行融合处理,得到融合原始数据;The first image signal processing module fuses the long exposure data and the short exposure data to obtain fused original data;
    所述第一图像信号处理模块对所述融合原始数据进行降噪处理。The first image signal processing module performs noise reduction processing on the fusion original data.
  3. 根据权利要求2所述的方法,其特征在于,所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据进行融合处理,包括:The method according to claim 2, wherein the first image signal processing module fuses the long exposure data and the short exposure data, including:
    所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据输入至第一目标模型中,由所述第一目标模型进行融合处理,所述第一目标模型能够对任意的长曝光数据和短曝光数据进行融合处理。The first image signal processing module inputs the long-exposure data and the short-exposure data into a first object model, and performs fusion processing by the first object model, and the first object model can Exposure data and short exposure data are fused.
  4. 根据权利要求2所述的方法,其特征在于,所述第一图像信号处理模块对所述融合原始数据进行降噪处理,包括:The method according to claim 2, wherein the first image signal processing module performs noise reduction processing on the fused raw data, including:
    所述第一图像信号处理模块将所述融合原始数据输入至第二目标模型中,由所述第二目标模型进行降噪处理,所述第二目标模型能够对任意的原始数据进行降噪处理。The first image signal processing module inputs the fused raw data into a second target model, and the second target model performs noise reduction processing, and the second target model can perform noise reduction processing on any raw data .
  5. 根据权利要求4所述的方法,其特征在于,所述第一图像信号处理模块中包括多个第二目标模型,所述多个第二目标模型中的每个第二目标模型对应有曝光数值范围;The method according to claim 4, wherein the first image signal processing module includes a plurality of second object models, and each second object model in the plurality of second object models corresponds to an exposure value scope;
    所述方法还包括:The method also includes:
    所述第一图像信号处理模块接收目标曝光数据,所述目标曝光数据是由所述第二图像信号处理模块基于第一曝光数据确定,所述第一曝光数据是由所述第二图像信号处理模块基于所述第二原始数据进行曝光数据统计得到,所述目标曝光数据用于调整所述图像感应器的曝光参数;The first image signal processing module receives target exposure data, the target exposure data is determined by the second image signal processing module based on the first exposure data, and the first exposure data is determined by the second image signal processing module The module obtains exposure data statistics based on the second raw data, and the target exposure data is used to adjust the exposure parameters of the image sensor;
    所述第一图像信号处理模块根据所述目标曝光数据、以及所述每个第二目标模型对应的曝光数值范围,从所述多个第二目标模型中选择一个第二目标模型,选择的第二目标模型用于降噪处理。The first image signal processing module selects a second target model from the plurality of second target models according to the target exposure data and the exposure value range corresponding to each second target model, and the selected second target model A two-objective model is used for denoising.
  6. 根据权利要求2所述的方法,其特征在于,所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据进行融合处理之前,还包括:The method according to claim 2, wherein, before the first image signal processing module fuses the long exposure data and the short exposure data, it further includes:
    所述第一图像信号处理模块对所述长曝光数据和所述短曝光数据进行预处理,所述预处理包括镜头校正LSC处理、黑电平补偿BLC处理、坏像素校正BPC处理、颜色插值处理中的至少一项;The first image signal processing module preprocesses the long exposure data and the short exposure data, and the preprocessing includes lens correction LSC processing, black level compensation BLC processing, bad pixel correction BPC processing, and color interpolation processing at least one of the
    所述第一图像信号处理模块将所述长曝光数据和所述短曝光数据进行融合处理,包括:The first image signal processing module fuses the long exposure data and the short exposure data, including:
    所述第一图像信号处理模块将预处理后的所述长曝光数据和所述短曝光数据进行融合处理。The first image signal processing module fuses the preprocessed long exposure data and the short exposure data.
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,所述第二图像信号处理模块基于所述视频增强数据和所述第二原始数据,生成视频帧,包括:The method according to any one of claims 1-6, wherein the second image signal processing module generates a video frame based on the video enhancement data and the second original data, comprising:
    所述第二图像信号处理模块对所述视频增强数据进行格式转换处理,得到YUV图像;The second image signal processing module performs format conversion processing on the video enhancement data to obtain a YUV image;
    所述第二图像信号处理模块基于所述第二原始数据,确定目标数据,所述目标数据用于调整所述YUV图像的图像质量;The second image signal processing module determines target data based on the second raw data, and the target data is used to adjust the image quality of the YUV image;
    所述第二图像信号处理模块基于所述目标数据调整所述YUV图像,并将调整后的所述YUV图像作为所述视频帧。The second image signal processing module adjusts the YUV image based on the target data, and uses the adjusted YUV image as the video frame.
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述图像感应器输出第一原始数据,包括:The method according to any one of claims 1-7, wherein the image sensor outputs the first raw data, comprising:
    通过所述电子设备中的相机应用检测到夜景视频拍摄指令,所述夜景视频拍摄指令用于指示在夜景模式下进行视频录制;A night scene video shooting instruction is detected through the camera application in the electronic device, and the night scene video shooting instruction is used to indicate video recording in night scene mode;
    响应于所述夜景视频拍摄指令,所述图像感应器输出所述第一原始数据。In response to the night scene video shooting instruction, the image sensor outputs the first raw data.
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述第二图像信号处理模块包括芯片级系统SOC中集成的图像信号处理器ISP,第一图像信号处理模块包括所述SOC外部的ISP。The method according to any one of claims 1-8, wherein the second image signal processing module includes an image signal processor ISP integrated in a chip-level system SOC, and the first image signal processing module includes the ISP outside the SOC.
  10. 一种生成视频帧的装置,其特征在于,所述装置包括:图像感应器节点、第一图像信号处理模块以及第二图像信号处理模块;A device for generating video frames, characterized in that the device includes: an image sensor node, a first image signal processing module, and a second image signal processing module;
    所述图像感应器节点,用于输出第一原始数据;The image sensor node is configured to output first raw data;
    所述第一图像信号处理模块,用于获取所述第一原始数据,复制所述第一原始数据,得到第二原始数据,对所述第一原始数据进行图像增强处理,得到视频增强数据,将所述视频增强数据以及所述第二原始数据发送给所述第二图像信号处理模块;The first image signal processing module is configured to acquire the first original data, copy the first original data to obtain second original data, and perform image enhancement processing on the first original data to obtain video enhanced data, sending the enhanced video data and the second raw data to the second image signal processing module;
    所述第二图像信号处理模块,用于基于所述视频增强数据和所述第二原始数据,生成视频帧。The second image signal processing module is configured to generate a video frame based on the video enhancement data and the second original data.
  11. 一种电子设备,其特征在于,所述电子设备包括存储器和处理器;An electronic device, characterized in that the electronic device includes a memory and a processor;
    所述存储器用于存储支持所述电子设备执行权利要求1-9任一项所述的方法的程序,以及存储用于实现权利要求1-9任一项所述的方法所涉及的数据;所述处理器被配置为用于执行所述存储器中存储的程序。The memory is used to store a program that supports the electronic device to execute the method described in any one of claims 1-9, and to store data involved in implementing the method described in any one of claims 1-9; The processor is configured to execute programs stored in the memory.
  12. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当其在计算机上运行时,使得计算机执行权利要求1-9任一项所述的方法。A computer-readable storage medium, with instructions stored in the computer-readable storage medium, is characterized in that, when the computer-readable storage medium is run on a computer, it causes the computer to execute the method described in any one of claims 1-9.
PCT/CN2022/116757 2021-11-05 2022-09-02 Video frame generation method and apparatus, electronic device, and storage medium WO2023077938A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202111316825.0 2021-11-05
CN202111316825 2021-11-05
CN202210254250.2A CN116095509B (en) 2021-11-05 2022-03-10 Method, device, electronic equipment and storage medium for generating video frame
CN202210254250.2 2022-03-10

Publications (1)

Publication Number Publication Date
WO2023077938A1 true WO2023077938A1 (en) 2023-05-11

Family

ID=86197906

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/116757 WO2023077938A1 (en) 2021-11-05 2022-09-02 Video frame generation method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN116095509B (en)
WO (1) WO2023077938A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040196390A1 (en) * 2003-04-02 2004-10-07 Matsushita Electric Industrial Co., Ltd. Image processing device and camera
CN109167915A (en) * 2018-09-29 2019-01-08 南昌黑鲨科技有限公司 Image processing method, system and computer readable storage medium
US20190087198A1 (en) * 2017-09-21 2019-03-21 Qualcomm Incorporated Fully extensible camera processing pipeline interface
CN110351489A (en) * 2018-04-04 2019-10-18 展讯通信(天津)有限公司 Generate the method, apparatus and mobile terminal of HDR image
WO2020103503A1 (en) * 2018-11-22 2020-05-28 Oppo广东移动通信有限公司 Night scene image processing method and apparatus, electronic device, and storage medium
CN111601019A (en) * 2020-02-28 2020-08-28 北京爱芯科技有限公司 Image data processing module and electronic equipment
JP2020137078A (en) * 2019-02-26 2020-08-31 株式会社ユピテル System, program, etc.
CN113448623A (en) * 2021-06-29 2021-09-28 北京紫光展锐通信技术有限公司 Image frame processing method, electronic device, chip and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780889B (en) * 2011-05-13 2015-04-01 中兴通讯股份有限公司 Video image processing method, device and equipment
CN109146814B (en) * 2018-08-20 2021-02-23 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN110633755A (en) * 2019-09-19 2019-12-31 北京市商汤科技开发有限公司 Network training method, image processing method and device and electronic equipment
CN112819699A (en) * 2019-11-15 2021-05-18 北京金山云网络技术有限公司 Video processing method and device and electronic equipment
CN112866802B (en) * 2019-11-27 2022-03-15 深圳市万普拉斯科技有限公司 Video processing method, video processing device, storage medium and computer equipment
CN113066020A (en) * 2021-03-11 2021-07-02 Oppo广东移动通信有限公司 Image processing method and device, computer readable medium and electronic device
CN113507598B (en) * 2021-07-09 2023-07-11 Oppo广东移动通信有限公司 Video picture display method, device, terminal and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040196390A1 (en) * 2003-04-02 2004-10-07 Matsushita Electric Industrial Co., Ltd. Image processing device and camera
US20190087198A1 (en) * 2017-09-21 2019-03-21 Qualcomm Incorporated Fully extensible camera processing pipeline interface
CN110351489A (en) * 2018-04-04 2019-10-18 展讯通信(天津)有限公司 Generate the method, apparatus and mobile terminal of HDR image
CN109167915A (en) * 2018-09-29 2019-01-08 南昌黑鲨科技有限公司 Image processing method, system and computer readable storage medium
WO2020103503A1 (en) * 2018-11-22 2020-05-28 Oppo广东移动通信有限公司 Night scene image processing method and apparatus, electronic device, and storage medium
JP2020137078A (en) * 2019-02-26 2020-08-31 株式会社ユピテル System, program, etc.
CN111601019A (en) * 2020-02-28 2020-08-28 北京爱芯科技有限公司 Image data processing module and electronic equipment
CN113448623A (en) * 2021-06-29 2021-09-28 北京紫光展锐通信技术有限公司 Image frame processing method, electronic device, chip and storage medium

Also Published As

Publication number Publication date
CN116095509A (en) 2023-05-09
CN116095509B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
WO2022262260A1 (en) Photographing method and electronic device
WO2021052232A1 (en) Time-lapse photography method and device
CN111418201B (en) Shooting method and equipment
CN113810600B (en) Terminal image processing method and device and terminal equipment
WO2023015981A1 (en) Image processing method and related device therefor
WO2021057277A1 (en) Photographing method in dark light and electronic device
CN113810601B (en) Terminal image processing method and device and terminal equipment
CN110381276B (en) Video shooting method and electronic equipment
CN111770282B (en) Image processing method and device, computer readable medium and terminal equipment
WO2020155052A1 (en) Method for selecting images based on continuous shooting and electronic device
WO2023160285A1 (en) Video processing method and apparatus
CN116055897B (en) Photographing method and related equipment thereof
WO2023077939A1 (en) Camera switching method and apparatus, and electronic device and storage medium
WO2024032033A1 (en) Video processing method and electronic device
CN115426449B (en) Photographing method and terminal
CN117135471A (en) Image processing method and electronic equipment
WO2023077938A1 (en) Video frame generation method and apparatus, electronic device, and storage medium
CN115706869A (en) Terminal image processing method and device and terminal equipment
CN112785537A (en) Image processing method, device and storage medium
WO2023160220A1 (en) Image processing method and electronic device
CN115705663B (en) Image processing method and electronic equipment
CN116048323B (en) Image processing method and electronic equipment
CN116723417B (en) Image processing method and electronic equipment
WO2023160221A1 (en) Image processing method and electronic device
CN116051368B (en) Image processing method and related device