CN118115375A - Image processing method, apparatus, electronic device, and computer-readable storage medium - Google Patents

Image processing method, apparatus, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
CN118115375A
CN118115375A CN202211499327.9A CN202211499327A CN118115375A CN 118115375 A CN118115375 A CN 118115375A CN 202211499327 A CN202211499327 A CN 202211499327A CN 118115375 A CN118115375 A CN 118115375A
Authority
CN
China
Prior art keywords
image
reference frame
feature
original images
features
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211499327.9A
Other languages
Chinese (zh)
Inventor
曾辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202211499327.9A priority Critical patent/CN118115375A/en
Publication of CN118115375A publication Critical patent/CN118115375A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4053Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The present application relates to an image processing method, an apparatus, an electronic device, a storage medium, and a computer program product. The method comprises the following steps: denoising and demosaicing the first image features extracted from at least two original images based on noise information of reference frames in the at least two original images to obtain second image features; the frequency of the second image feature is lower than a preset frequency threshold; performing super-resolution processing on the second image features to obtain third image features; the frequency of the third image feature is higher than or equal to a preset frequency threshold; and generating a target image according to the second image characteristic and the third image characteristic. By adopting the method, the accuracy of image processing can be improved.

Description

图像处理方法、装置、电子设备和计算机可读存储介质Image processing method, device, electronic device and computer-readable storage medium

技术领域Technical Field

本申请涉及影像技术领域,特别是涉及一种图像处理方法、装置、电子设备和计算机可读存储介质。The present application relates to the field of imaging technology, and in particular to an image processing method, device, electronic device and computer-readable storage medium.

背景技术Background technique

随着影像技术的发展,出现了多帧图像融合的技术,多帧图像融合过程中,通常需要进行ISP(Image Signal Processing,图像信号处理)处理,包括解马赛克、去噪、白平衡、色调映射、对比度增强等,从而融合得到最终的图像。With the development of imaging technology, multi-frame image fusion technology has emerged. During the multi-frame image fusion process, ISP (Image Signal Processing) processing is usually required, including demosaicing, denoising, white balance, tone mapping, contrast enhancement, etc., so as to fuse the final image.

然而,传统的图像处理方法,存在图像处理准确性不高的问题。However, traditional image processing methods have the problem of low image processing accuracy.

发明内容Summary of the invention

本申请实施例提供了一种图像处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品,可以提高图像处理的准确性。Embodiments of the present application provide an image processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of image processing.

第一方面,本申请提供了一种图像处理方法。所述方法包括:In a first aspect, the present application provides an image processing method. The method comprises:

基于至少两个原始图像中参考帧的噪声信息,对从所述至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;所述第二图像特征的频率低于预设频率阈值;Based on noise information of a reference frame in at least two original images, performing denoising and demosaicing processing on a first image feature extracted from the at least two original images to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold;

对所述第二图像特征进行超分辨率处理,得到第三图像特征;所述第三图像特征的频率高于或等于预设频率阈值;Performing super-resolution processing on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold;

根据所述第二图像特征和所述第三图像特征,生成目标图像。A target image is generated according to the second image feature and the third image feature.

第二方面,本申请还提供了一种图像处理装置。所述装置包括:In a second aspect, the present application also provides an image processing device. The device comprises:

第一处理模块,用于基于至少两个原始图像中参考帧的噪声信息,对从所述至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;所述第二图像特征的频率低于预设频率阈值;A first processing module is used to perform denoising and demosaicing processing on a first image feature extracted from the at least two original images based on noise information of a reference frame in the at least two original images to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold;

第二处理模块,用于对所述第二图像特征进行超分辨率处理,得到第三图像特征;所述第三图像特征的频率高于或等于预设频率阈值;A second processing module, configured to perform super-resolution processing on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold;

图像生成模块,用于根据所述第二图像特征和所述第三图像特征,生成目标图像。An image generation module is used to generate a target image according to the second image feature and the third image feature.

第三方面,本申请还提供了一种电子设备。所述电子设备包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

基于至少两个原始图像中参考帧的噪声信息,对从所述至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;所述第二图像特征的频率低于预设频率阈值;Based on noise information of a reference frame in at least two original images, performing denoising and demosaicing processing on a first image feature extracted from the at least two original images to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold;

对所述第二图像特征进行超分辨率处理,得到第三图像特征;所述第三图像特征的频率高于或等于预设频率阈值;Performing super-resolution processing on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold;

根据所述第二图像特征和所述第三图像特征,生成目标图像。A target image is generated according to the second image feature and the third image feature.

第四方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

基于至少两个原始图像中参考帧的噪声信息,对从所述至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;所述第二图像特征的频率低于预设频率阈值;Based on noise information of a reference frame in at least two original images, performing denoising and demosaicing processing on a first image feature extracted from the at least two original images to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold;

对所述第二图像特征进行超分辨率处理,得到第三图像特征;所述第三图像特征的频率高于或等于预设频率阈值;Performing super-resolution processing on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold;

根据所述第二图像特征和所述第三图像特征,生成目标图像。A target image is generated according to the second image feature and the third image feature.

第五方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

基于至少两个原始图像中参考帧的噪声信息,对从所述至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;所述第二图像特征的频率低于预设频率阈值;Based on noise information of a reference frame in at least two original images, performing denoising and demosaicing processing on a first image feature extracted from the at least two original images to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold;

对所述第二图像特征进行超分辨率处理,得到第三图像特征;所述第三图像特征的频率高于或等于预设频率阈值;Performing super-resolution processing on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold;

根据所述第二图像特征和所述第三图像特征,生成目标图像。A target image is generated according to the second image feature and the third image feature.

上述图像处理方法、装置、电子设备、计算机可读存储介质和计算机程序产品,基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到频率低于预设频率阈值的第二图像特征;对第二图像特征进行超分辨率处理,得到频率高于或等于预设频率阈值的第三图像特征;也就是说,通过去噪处理和解马赛克处理可以更准确地得到图像的低频色彩轮廓等信息,且通过超分辨率处理可以更准确地得到图像的高频纹理细节等信息,从而根据第二图像特征和第三图像特征,生成去噪、解马赛克和超分辨率的目标图像,提高了图像处理的准确性。The above-mentioned image processing method, device, electronic device, computer-readable storage medium and computer program product, based on the noise information of the reference frame in the at least two original images, perform denoising and demosaicing on the first image feature extracted from the at least two original images to obtain a second image feature with a frequency lower than a preset frequency threshold; perform super-resolution processing on the second image feature to obtain a third image feature with a frequency higher than or equal to the preset frequency threshold; that is, through denoising and demosaicing, information such as the low-frequency color contour of the image can be more accurately obtained, and through super-resolution processing, information such as the high-frequency texture details of the image can be more accurately obtained, thereby generating a denoised, demosaiced and super-resolution target image based on the second image feature and the third image feature, thereby improving the accuracy of image processing.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

图1为一个实施例中图像处理方法的流程图;FIG1 is a flow chart of an image processing method according to an embodiment;

图2为另一个实施例中图像处理方法的流程图;FIG2 is a flow chart of an image processing method in another embodiment;

图3为另一个实施例中图像处理方法的流程图;FIG3 is a flow chart of an image processing method in another embodiment;

图4为另一个实施例中图像处理方法的流程图;FIG4 is a flow chart of an image processing method in another embodiment;

图5为另一个实施例中图像处理方法的流程图;FIG5 is a flow chart of an image processing method in another embodiment;

图6为另一个实施例中图像处理方法的流程图;FIG6 is a flow chart of an image processing method in another embodiment;

图7为另一个实施例中生成待输入网络的多帧图像的流程图;FIG7 is a flow chart of generating multiple frames of images to be input into a network in another embodiment;

图8为另一个实施例中图像处理方法的流程图;FIG8 is a flow chart of an image processing method in another embodiment;

图9为一个实施例中图像处理装置的结构框图;FIG9 is a block diagram of an image processing device according to an embodiment;

图10为一个实施例中电子设备的内部结构图。FIG. 10 is a diagram showing the internal structure of an electronic device in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

在一个实施例中,如图1所示,提供了一种图像处理方法,本实施例以该方法应用于电子设备进行举例说明,电子设备可以是终端或者服务器;可以理解的是,该方法也可以应用于包括终端和服务器的系统,并通过终端和服务器的交互实现。其中,终端可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑、物联网设备和便携式可穿戴设备,物联网设备可为智能音箱、智能电视、智能空调、智能车载设备、智能汽车等。便携式可穿戴设备可为智能手表、智能手环、头戴设备等。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。In one embodiment, as shown in FIG1 , an image processing method is provided. This embodiment is illustrated by applying the method to an electronic device, which may be a terminal or a server. It is understandable that the method may also be applied to a system including a terminal and a server, and implemented through the interaction between the terminal and the server. Among them, the terminal may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, smart cars, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server may be implemented as an independent server or a server cluster consisting of multiple servers.

本实施例中,该图像处理方法包括以下步骤:In this embodiment, the image processing method includes the following steps:

步骤S102,基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;第二图像特征的频率低于预设频率阈值。Step S102, based on the noise information of the reference frame in the at least two original images, denoising and demosaicing are performed on the first image feature extracted from the at least two original images to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold.

可以理解的是,原始图像可以是RAW域图像,也即原始的、未经处理过的图像数据。It can be understood that the original image may be a RAW domain image, that is, original, unprocessed image data.

参考帧是在配准过程中用于参考的图像。可选地,参考帧可以是至少两个原始图像中清晰度最高的图像,也可以是至少两个原始图像中亮度最高的图像,在此不做限定。参考帧的噪声信息可以是参考帧的噪声图。The reference frame is an image used for reference in the registration process. Optionally, the reference frame can be the image with the highest definition among at least two original images, or the image with the highest brightness among at least two original images, which is not limited here. The noise information of the reference frame can be a noise map of the reference frame.

去噪处理是指减少数字图像中噪声的过程。解马赛克,也即去马赛克(demosaicing,也写作de-mosaicing、demosaicking或debayering)是一种数位影像处理算法,目的是从覆有滤色阵列(Color filter array,简称CFA)的感光元件所输出的不完全色彩取样中,重建出全彩影像。此法也称为滤色阵列内插法(CFA interpolation)或色彩重建法(Color reconstruction)。De-noising is the process of reducing noise in digital images. De-mosaicing (also known as de-mosaicing, demosaicking or debayering) is a digital image processing algorithm that aims to reconstruct a full-color image from the incomplete color samples output by a photosensitive element covered with a color filter array (CFA). This method is also called color filter array interpolation (CFA interpolation) or color reconstruction.

预设频率阈值可以根据需要进行设置。第二图像特征的频率低于预设频率阈值,也即第二图像特征包括低频图像特征。低频即颜色缓慢地变化,也就是灰度缓慢地变化,代表着那是连续渐变的一块区域,这部分就是低频。对于一幅图像来说,边缘以内的内容为低频,而边缘内的内容就是图像的大部分信息,即图像的大致概貌和轮廓,是图像的近似信息。示例性的,第二图像特征可以包括轮廓、色彩等信息。The preset frequency threshold can be set as needed. The frequency of the second image feature is lower than the preset frequency threshold, that is, the second image feature includes a low-frequency image feature. Low frequency means that the color changes slowly, that is, the grayscale changes slowly, which represents an area of continuous gradient, and this part is low frequency. For an image, the content within the edge is low frequency, and the content within the edge is most of the information of the image, that is, the general outline and contour of the image, which is the approximate information of the image. Exemplarily, the second image feature may include contour, color and other information.

可选地,电子设备通过图像传感器获取至少两个RAW域的原始图像;将至少两个RAW域的原始图像输入联合解马赛克、去噪与超分辨率网络;在该联合解马赛克、去噪与超分辨率网络中,对至少两个RAW域的原始图像进行解马赛克处理、去噪处理和超分辨率处理,得到目标图像。Optionally, the electronic device obtains original images in at least two RAW domains through an image sensor; inputs the original images in at least two RAW domains into a joint demosaicing, denoising and super-resolution network; in the joint demosaicing, denoising and super-resolution network, performs demosaicing, denoising and super-resolution processing on the original images in at least two RAW domains to obtain a target image.

可选地,在该联合解马赛克、去噪与超分辨率网络中,从至少两个原始图像中提取第一图像特征,以及从至少两个原始图像中确定参考帧;获取参考帧的噪声信息;基于参考帧的噪声信息,对第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征。Optionally, in the joint demosaicing, denoising and super-resolution network, a first image feature is extracted from at least two original images, and a reference frame is determined from at least two original images; noise information of the reference frame is obtained; and based on the noise information of the reference frame, the first image feature is denoised and demosaiced to obtain a second image feature.

步骤S104,对第二图像特征进行超分辨率处理,得到第三图像特征;第三图像特征的频率高于或等于预设频率阈值。Step S104, super-resolution processing is performed on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold.

超分辨率处理是通过硬件或软件的方法提高原有图像的分辨率,通过一系列低分辨率的图像来得到一幅高分辨率的图像过程就是超分辨率重建。超分辨率的倍率可以根据需要进行设置。示例性的,超分辨率处理可以是2倍超分辨率。Super-resolution processing is to improve the resolution of the original image by hardware or software methods. The process of obtaining a high-resolution image through a series of low-resolution images is super-resolution reconstruction. The super-resolution ratio can be set as needed. For example, super-resolution processing can be 2x super-resolution.

第三图像特征的频率高于或等于预设频率阈值,也即第三图像特征包括高频图像特征。高频即频率变化快,在相邻区域之间灰度相差很大的图像边缘位置,对应的灰度变化快;以及图像的细节处也是属于灰度值急剧变化的区域,正是因为灰度值的急剧变化,才会出现细节。示例性的,第三图像特征包括边缘和细节等信息。The frequency of the third image feature is higher than or equal to the preset frequency threshold, that is, the third image feature includes a high-frequency image feature. High frequency means that the frequency changes quickly. At the edge of the image where the grayscale difference between adjacent areas is large, the corresponding grayscale changes quickly; and the details of the image are also areas where the grayscale value changes sharply. It is precisely because of the sharp change in the grayscale value that details appear. Exemplarily, the third image feature includes information such as edges and details.

可选地,电子设备将第二图像特征输入超分辨率模块(Super-resolutionimaging,SR),通过超分辨率模块对第二图像特征进行超分辨率处理,得到超分辨率处理后的第三图像特征。Optionally, the electronic device inputs the second image feature into a super-resolution module (Super-resolution imaging, SR), and performs super-resolution processing on the second image feature through the super-resolution module to obtain a third image feature after super-resolution processing.

步骤S106,根据第二图像特征和第三图像特征,生成目标图像。Step S106: Generate a target image according to the second image feature and the third image feature.

可选地,电子设备将第二图像特征和第三图像特征相加,生成目标图像。Optionally, the electronic device adds the second image feature and the third image feature to generate a target image.

可选地,电子设备将第二图像特征和第三图像特征分别乘以对应的权重因子,再进行相加生成目标图像。权重因子可以根据需要进行设置。Optionally, the electronic device multiplies the second image feature and the third image feature by corresponding weight factors respectively, and then adds them together to generate the target image. The weight factors can be set as needed.

可选地,电子设备从第二图像特征中选取第一部分特征,从第三图像特征中选取第二部分特征,将第一部分特征和第二部分特征相加,生成目标图像。Optionally, the electronic device selects a first portion of features from the second image features, selects a second portion of features from the third image features, adds the first portion of features and the second portion of features, and generates a target image.

需要说明的是,根据第二图像特征和第三图像特征生成目标图像的方式,可以根据需要进行设置,在此不做限定。It should be noted that the method of generating the target image according to the second image feature and the third image feature can be set as needed and is not limited here.

上述图像处理方法,基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到频率低于预设频率阈值的第二图像特征;对第二图像特征进行超分辨率处理,得到频率高于或等于预设频率阈值的第三图像特征;也就是说,通过去噪处理和解马赛克处理可以更准确地得到图像的低频色彩轮廓等信息,且通过超分辨率处理可以更准确地得到图像的高频纹理细节等信息,从而根据第二图像特征和第三图像特征,生成去噪、细节丰富且真实和超分辨率的目标图像,提高了图像处理的准确性。同时可以满足电子设备的图像处理速度、功耗、算力及分辨率等的要求。The above-mentioned image processing method performs denoising and demosaicing on the first image feature extracted from at least two original images based on the noise information of the reference frame in at least two original images, and obtains a second image feature with a frequency lower than a preset frequency threshold; performs super-resolution processing on the second image feature, and obtains a third image feature with a frequency higher than or equal to the preset frequency threshold; that is, through denoising and demosaicing, information such as the low-frequency color contour of the image can be obtained more accurately, and through super-resolution processing, information such as the high-frequency texture details of the image can be obtained more accurately, so as to generate a denoised, detail-rich, realistic and super-resolution target image based on the second image feature and the third image feature, thereby improving the accuracy of image processing. At the same time, it can meet the requirements of image processing speed, power consumption, computing power and resolution of electronic equipment.

并且,通过联合解马赛克、去噪与超分辨率网络架构,输出低频分量的第二图像特征和高频分量的第三图像特征,可以提升了该联合解马赛克、去噪与超分辨率网络架构中各部分的利用率,使超分辨率处理部分专注于恢复图像的高频纹理细节信息,而联合解马赛克和去噪部分可以专注于恢复图像的低频信息。另外,高低频分离的策略使可以在去噪力度、超分辨率倍数等方面具有了更大的自由度,支持根据不同的应用场景进行定制。Moreover, by jointly de-mosaicing, denoising and super-resolution network architecture, the second image features of low-frequency components and the third image features of high-frequency components are output, which can improve the utilization rate of each part in the joint de-mosaicing, denoising and super-resolution network architecture, so that the super-resolution processing part can focus on restoring the high-frequency texture detail information of the image, while the joint de-mosaicing and denoising part can focus on restoring the low-frequency information of the image. In addition, the strategy of separating high and low frequencies allows greater freedom in terms of denoising strength, super-resolution multiples, etc., and supports customization according to different application scenarios.

在一个实施例中,基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征,包括:基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理,得到去噪图像特征;对去噪图像特征进行解马赛克处理,得到第二图像特征。In one embodiment, based on the noise information of the reference frame in at least two original images, a first image feature extracted from at least two original images is denoised and demosaiced to obtain a second image feature, including: based on the noise information of the reference frame in at least two original images, a first image feature extracted from at least two original images is denoised to obtain a denoised image feature; and a denoised image feature is demosaiced to obtain a second image feature.

可以理解的是,电子设备基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理,可以得到去噪后的去噪图像特征,再对去噪图像特征进行解马赛克处理,可以准确地得到去噪后且解马赛克的第二图像特征。It can be understood that the electronic device performs denoising processing on the first image features extracted from at least two original images based on the noise information of the reference frame in the at least two original images, so as to obtain the denoised image features after denoising, and then performs demosaicing processing on the denoised image features, so as to accurately obtain the denoised and demosaiced second image features.

在另一个实施例中,电子设备也可以先对第一图像特征进行解马赛克处理,再进行去噪处理,得到第二图像特征。In another embodiment, the electronic device may also first perform a demosaicing process on the first image feature, and then perform a denoising process to obtain the second image feature.

在一个实施例中,基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理,得到去噪图像特征,包括:对至少两个原始图像中参考帧的噪声信息和从至少两个原始图像中提取的第一图像特征进行特征映射,得到映射特征;对映射特征进行去噪处理,得到去噪图像特征。In one embodiment, based on the noise information of the reference frame in at least two original images, a first image feature extracted from at least two original images is denoised to obtain a denoised image feature, including: performing feature mapping on the noise information of the reference frame in at least two original images and the first image feature extracted from at least two original images to obtain a mapping feature; and denoising the mapping feature to obtain a denoised image feature.

可选地,对映射特征进行去噪处理,得到去噪图像特征,包括:对映射特征依次进行降采样和上采样,得到上采样特征;上采样特征的分辨率和映射特征的分辨率相同;基于上采样特征和映射特征,得到去噪图像特征。其中,噪声信息可以是噪声图。Optionally, performing denoising on the mapping features to obtain denoised image features includes: sequentially downsampling and upsampling the mapping features to obtain upsampled features; the resolution of the upsampled features is the same as the resolution of the mapping features; and obtaining denoised image features based on the upsampled features and the mapping features. The noise information may be a noise map.

其中,降采样,又作减采集,是一种多速率数字信号处理的技术或是降低信号采样率的过程,通常用于降低数据传输速率或者数据大小。上采样也称增取样(Upsampling)或内插(Interpolating)。Downsampling, also known as subsampling, is a multi-rate digital signal processing technology or the process of reducing the signal sampling rate, usually used to reduce the data transmission rate or data size. Upsampling is also called upsampling or interpolating.

电子设备以一层卷积层和激活函数层将参考帧的噪声图和第一图像特征进行特征映射,得到去噪模块能够处理的映射特征;将映射特征输入包含4次2倍降采样及4次2倍上采样的UResNet模块,依次对映射特征进行降采样和上采样,得到上采样特征;将上采样特征和映射特征在通道维度拼接,得到去噪图像特征。其中,UResNet模块是以残差模块为基本处理单元的UNet,每次上采样后的输出与降采样前的同分辨率特征在通道维度拼接后输入后续的上采样模块。UResNet模块中降采样和上采样的次数和倍率均可以根据需要进行设置,在此不做限定。The electronic device uses a convolution layer and an activation function layer to perform feature mapping on the noise map of the reference frame and the first image feature to obtain mapping features that can be processed by the denoising module; the mapping features are input into a UResNet module that includes 4 times of 2x downsampling and 4 times of 2x upsampling, and the mapping features are downsampled and upsampled in turn to obtain upsampled features; the upsampled features and the mapping features are spliced in the channel dimension to obtain denoised image features. Among them, the UResNet module is a UNet with the residual module as the basic processing unit. The output after each upsampling is spliced with the same resolution features before downsampling in the channel dimension and then input into the subsequent upsampling module. The number and ratio of downsampling and upsampling in the UResNet module can be set as needed and are not limited here.

在本实施例中,电子设备对至少两个原始图像中参考帧的噪声信息和从至少两个原始图像中提取的第一图像特征进行特征映射,得到映射特征,再对映射特征进行去噪处理,可以得到去噪的去噪图像特征,提升图像特征的去噪效果。In this embodiment, the electronic device performs feature mapping on the noise information of the reference frame in at least two original images and the first image features extracted from the at least two original images to obtain mapping features, and then performs denoising processing on the mapping features to obtain denoised denoised image features, thereby improving the denoising effect of the image features.

在一个实施例中,对去噪图像特征进行解马赛克处理,得到第二图像特征,包括:对去噪图像特征进行上采样和残差处理,得到第二图像特征。In one embodiment, performing demosaicing processing on the denoised image feature to obtain the second image feature includes: performing upsampling and residual processing on the denoised image feature to obtain the second image feature.

可选地,电子设备对去噪图像特征进行2倍上采样,再将得到的图像特征输入包含2个深度残差模块的网络进行残差处理,可以得到联合解马赛克及去噪后的第二图像特征。其中,包括深度残差模块的网络中深度残差模块的数量可以根据需要进行设置。Optionally, the electronic device performs a 2-fold upsampling on the denoised image features, and then inputs the obtained image features into a network including two deep residual modules for residual processing, so as to obtain a second image feature after joint demosaicing and denoising. The number of deep residual modules in the network including the deep residual module can be set as needed.

可选地,电子设备还可以将第二图像特征经过两个卷积层进行处理,得到RGB域的第一图像分量。Optionally, the electronic device may also process the second image feature through two convolution layers to obtain a first image component in the RGB domain.

在一个实施例中,对第二图像特征进行超分辨率处理,得到第三图像特征,包括:对第二图像特征进行残差处理,得到残差处理特征;对残差处理特征进行上采样,得到第三图像特征。In one embodiment, super-resolution processing is performed on the second image feature to obtain the third image feature, including: performing residual processing on the second image feature to obtain a residual processing feature; and up-sampling the residual processing feature to obtain the third image feature.

可选地,电子设备将第二图像特征输入包含深度残差模块的网络,通过该包含深度残差模块的网络进行残差处理,得到残差处理特征;对残差处理特征进行上采样,得到第三图像特征。Optionally, the electronic device inputs the second image feature into a network including a deep residual module, performs residual processing through the network including the deep residual module to obtain a residual processing feature; and upsamples the residual processing feature to obtain a third image feature.

其中,包括深度残差模块的网络中深度残差模块的数量可以根据需要进行设置。示例性的,为了平衡处理效率和处理效果,该网络可以包括8个深度残差模块。The number of the deep residual modules in the network including the deep residual modules can be set as needed. Exemplarily, in order to balance the processing efficiency and the processing effect, the network may include 8 deep residual modules.

可选地,电子设备可以采用最近邻插值的方式对残差处理特征进行上采样,得到第三图像特征。Optionally, the electronic device may upsample the residual processing feature by using a nearest neighbor interpolation method to obtain a third image feature.

可选地,以2倍超分辨率处理为例,电子设备对第二图像特征进行残差处理,得到残差处理特征;对残差处理特征进行2倍上采样,得到第三图像特征。Optionally, taking 2x super-resolution processing as an example, the electronic device performs residual processing on the second image feature to obtain a residual processing feature; and performs 2x upsampling on the residual processing feature to obtain a third image feature.

对于大于1倍且小于2倍的超分辨率倍率需求,电子设备对残差处理特征进行预设倍率的上采样,得到第三图像特征;且对第二图像特征进行预设被倍率的上采样,得到上采样后第二图像特征。其中,预设倍率大于1且小于2。For a super-resolution ratio greater than 1 and less than 2, the electronic device upsamples the residual processing feature by a preset ratio to obtain a third image feature, and upsamples the second image feature by a preset ratio to obtain an upsampled second image feature. The preset ratio is greater than 1 and less than 2.

对于大于2倍的超分辨率倍率需求,电子设备并联一个预设倍率的超分辨率处理分支,得到预设倍率的第三图像特征;同时,以2倍(或其他与预设倍率最接近的、小于预设倍率的、2的整数次幂的倍数)的第二图像特征乘以对应倍数的上采样,得到上采样后第二图像特征。For super-resolution ratio requirements greater than 2 times, the electronic device connects a super-resolution processing branch with a preset ratio in parallel to obtain a third image feature with the preset ratio; at the same time, the second image feature is multiplied by 2 times (or other multiples of an integer power of 2 that are closest to the preset ratio and less than the preset ratio) by the corresponding upsampling multiple to obtain the upsampled second image feature.

示例性的,对于8倍的超分辨率倍率需求,电子设备在超分辨率处理,以及联合去噪和解马赛克处理时均增加上采样的次数到3次,也即第一次2倍上采样得到2倍,再进行第二次2倍上采样后得到4倍,再进行第三次2倍上采样后得到8倍。For example, for an 8x super-resolution ratio requirement, the electronic device increases the number of upsampling times to 3 during super-resolution processing, as well as joint denoising and demosaicing processing, that is, the first 2x upsampling results in 2x, the second 2x upsampling results in 4x, and the third 2x upsampling results in 8x.

可选地,电子设备还可以将第三图像特征经过两个卷积层进行处理,得到RGB域的第二图像分量;将RGB域的第一图像分量和RGB域的第二图像分量相加,可以得到RGB域的目标图像。Optionally, the electronic device may also process the third image feature through two convolutional layers to obtain a second image component in the RGB domain; and add the first image component in the RGB domain and the second image component in the RGB domain to obtain a target image in the RGB domain.

在本实施例中,对第二图像特征进行残差处理,得到残差处理特征,对残差处理特征进行上采样,可以准确地得到超分辨率的第三图像特征。In this embodiment, residual processing is performed on the second image feature to obtain a residual processing feature, and the residual processing feature is upsampled to accurately obtain a third image feature with super resolution.

在一个实施例中,如图2所示,还提供了另一种图像处理方法,包括以下步骤:In one embodiment, as shown in FIG2 , another image processing method is provided, comprising the following steps:

步骤S202,对至少两个原始图像中参考帧的噪声信息和从至少两个原始图像中提取的第一图像特征进行特征映射,得到映射特征。Step S202 , performing feature mapping on noise information of a reference frame in at least two original images and first image features extracted from at least two original images to obtain mapping features.

步骤S204,对映射特征依次进行降采样和上采样,得到上采样特征;上采样特征的分辨率和映射特征的分辨率相同。Step S204, downsampling and upsampling the mapping features in sequence to obtain upsampled features; the resolution of the upsampled features is the same as the resolution of the mapping features.

需要说明的是,电子设备对映射特征依次进行降采样和上采样,可以实现去噪效果。It should be noted that the electronic device can achieve a denoising effect by sequentially downsampling and upsampling the mapping features.

步骤S206,基于上采样特征和映射特征,得到去噪图像特征。Step S206: obtaining denoised image features based on the up-sampling features and the mapping features.

步骤S208,对去噪图像特征进行上采样和残差处理,得到第二图像特征;第二图像特征的频率低于预设频率阈值。Step S208, upsampling and residual processing are performed on the denoised image feature to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold.

步骤S210,对第二图像特征进行残差处理,得到残差处理特征;对残差处理特征进行预设倍率的上采样,得到第三图像特征;第三图像特征的频率高于或等于预设频率阈值。Step S210, performing residual processing on the second image feature to obtain a residual processing feature; performing upsampling on the residual processing feature at a preset ratio to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold.

预设倍率可以根据需要进行设置。示例性的,预设倍率可以是2倍。The preset magnification can be set as needed. For example, the preset magnification can be 2 times.

步骤S212,对第二图像特征进行预设倍率的上采样,得到上采样后第二图像特征。Step S212, upsampling the second image feature at a preset ratio to obtain an upsampled second image feature.

可以理解的是,第三图像特征是在第二图像特征的基础上,还包括有预设倍率的上采样,故第三图像特征的分辨率高于第二图像特征的分辨率。为了使得更准确得到合成的目标图像,电子设备对第二图像特征也进行预设倍率的上采样,得到上采样后的第二图像特征;上采样后的第二图像特征的分辨率和第三图像特征的分辨率一致。It is understandable that the third image feature is based on the second image feature and also includes upsampling at a preset magnification, so the resolution of the third image feature is higher than that of the second image feature. In order to obtain the synthesized target image more accurately, the electronic device also upsamples the second image feature at a preset magnification to obtain the upsampled second image feature; the resolution of the upsampled second image feature is consistent with the resolution of the third image feature.

可选地,电子设备以双三次插值(Bicubic interpolation)方式对第二图像特征进行预设倍率的上采样,得到上采样后第二图像特征。Optionally, the electronic device upsamples the second image feature by a preset ratio in a bicubic interpolation manner to obtain the upsampled second image feature.

步骤S214,根据上采样后第二图像特征和第三图像特征,生成目标图像。Step S214: Generate a target image according to the upsampled second image features and the third image features.

在本实施例中,电子设备对第二图像特征进行残差处理,得到残差处理特征,再对残差处理特征进行预设倍率的上采样,得到第三图像特征,并且对第二图像特征也进行预设倍率的上采样,得到上采样后第二图像特征,该上采样后第二图像特征和第三图像特征的分辨率一致,从而可以根据分辨率一致的上采样后第二图像特征和第三图像特征,更准确地生成目标图像。In this embodiment, the electronic device performs residual processing on the second image feature to obtain a residual processing feature, then upsamples the residual processing feature at a preset ratio to obtain a third image feature, and also upsamples the second image feature at a preset ratio to obtain an upsampled second image feature. The upsampled second image feature and the third image feature have consistent resolutions, thereby more accurately generating a target image based on the upsampled second image feature and the third image feature with consistent resolutions.

在一个实施例中,从至少两个原始图像中提取第一图像特征,包括:从至少两个原始图像中提取每个原始图像的子图像特征;将至少两个子图像特征进行融合,得到第一图像特征。In one embodiment, extracting the first image feature from at least two original images includes: extracting a sub-image feature of each original image from the at least two original images; and fusing the at least two sub-image features to obtain the first image feature.

可选地,电子设备通过多层卷积层从至少两个原始图像中提取每个原始图像的子图像特征,通过卷积层或自注意力机制将至少两个子图像特征进行融合,得到第一图像特征。Optionally, the electronic device extracts sub-image features of each original image from at least two original images through multiple convolutional layers, and fuses at least two sub-image features through a convolutional layer or a self-attention mechanism to obtain a first image feature.

在本实施例中,电子设备从至少两个原始图像中提取每个原始图像的子图像特征,可以利用至少两个子图像特征之间的互补信息,将至少两个子图像特征进行融合,得到图像信息更多的第一图像特征。In this embodiment, the electronic device extracts sub-image features of each original image from at least two original images, and can fuse the at least two sub-image features using complementary information between the at least two sub-image features to obtain a first image feature with more image information.

在一个实施例中,如图3所示,提供了另一种图像处理方法,包括以下步骤:In one embodiment, as shown in FIG3 , another image processing method is provided, comprising the following steps:

步骤S302,获取至少两个原始图像中除参考帧之外的每个非参考帧的运动区域掩码。Step S302: Obtain a motion region mask of each non-reference frame except the reference frame in at least two original images.

可选地,电子设备从至少两个原始图像中确定参考帧以及除参考帧之外的非参考帧;检测各个非参考帧的运动区域,生成每个非参考帧的运动区域掩码。Optionally, the electronic device determines a reference frame and a non-reference frame other than the reference frame from at least two original images; detects motion regions of each non-reference frame, and generates a motion region mask for each non-reference frame.

步骤S304,基于参考帧、非参考帧和对应的运动区域掩码,提取每个原始图像的子图像特征。Step S304: extracting sub-image features of each original image based on the reference frame, the non-reference frame and the corresponding motion region mask.

可选地,电子设备无需对参考帧进行运动检测,也即参考帧的运动区域掩码为全黑图;电子设备将参考帧和对应的运动区域掩码在通道维度上串联,以及将非参考帧和对应的运动区域掩码在通道维度上串联,得到串联后参考帧和串联后非参考帧;通过特征提取网络从串联后参考帧和串联后非参考帧提取每个原始图像的子图像特征。其中,特征提取网络可以包括多层卷积层。示例性的,RAW域的原始图像包括4个通道,将运动区域掩码和RAW域的原始图像在通道维度上串联,则生成新的RAW域的原始图像包括5个通道,包括原来的4个通道和运动区域掩码这一通道。Optionally, the electronic device does not need to perform motion detection on the reference frame, that is, the motion area mask of the reference frame is a completely black image; the electronic device concatenates the reference frame and the corresponding motion area mask in the channel dimension, and concatenates the non-reference frame and the corresponding motion area mask in the channel dimension to obtain a concatenated reference frame and a concatenated non-reference frame; and extracts sub-image features of each original image from the concatenated reference frame and the concatenated non-reference frame through a feature extraction network. Among them, the feature extraction network may include multiple convolutional layers. Exemplarily, the original image in the RAW domain includes 4 channels, and the motion area mask and the original image in the RAW domain are concatenated in the channel dimension, then the new original image in the RAW domain is generated to include 5 channels, including the original 4 channels and the channel of the motion area mask.

可选地,电子设备还可以将参考帧和串联后非参考帧输入特征提取网络中进行特征提取。Optionally, the electronic device may also input the reference frame and the concatenated non-reference frame into a feature extraction network for feature extraction.

可以理解的是,图像和运动区域掩码在通道维度上串联,即运动区域掩码作为图像新增的一个通道。It can be understood that the image and the motion area mask are connected in series in the channel dimension, that is, the motion area mask serves as a new channel added to the image.

步骤S306,将至少两个子图像特征进行融合,得到第一图像特征。Step S306: fuse at least two sub-image features to obtain a first image feature.

步骤S308,对至少两个原始图像中参考帧的噪声信息和第一图像特征进行特征映射,得到映射特征。Step S308: performing feature mapping on the noise information of the reference frame and the first image features in at least two original images to obtain mapping features.

步骤S310,对映射特征依次进行降采样和上采样,得到上采样特征;上采样特征的分辨率和映射特征的分辨率相同。Step S310, down-sampling and up-sampling the mapping features in sequence to obtain up-sampled features; the resolution of the up-sampled features is the same as the resolution of the mapping features.

步骤S312,基于上采样特征和映射特征,得到去噪图像特征。Step S312: obtaining denoised image features based on the up-sampling features and the mapping features.

步骤S314,对去噪图像特征进行上采样和残差处理,得到第二图像特征;第二图像特征的频率低于预设频率阈值。Step S314, upsampling and residual processing are performed on the denoised image feature to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold.

步骤S316,对第二图像特征进行残差处理,得到残差处理特征。Step S316, performing residual processing on the second image feature to obtain a residual processing feature.

步骤S318,对残差处理特征进行预设倍率的上采样,得到第三图像特征;第三图像特征的频率高于或等于预设频率阈值。Step S318, up-sampling the residual processing feature at a preset rate to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold.

步骤S320,对第二图像特征进行预设倍率的上采样,得到上采样后第二图像特征。Step S320, upsampling the second image feature at a preset ratio to obtain an upsampled second image feature.

步骤S322,根据上采样后第二图像特征和第三图像特征,生成目标图像。Step S322: Generate a target image according to the upsampled second image features and the third image features.

在本实施例中,电子设备可以将获取至少两个原始图像中除参考帧之外的每个非参考帧的运动区域掩码,基于参考帧、非参考帧和对应的运动区域掩码,可以确定每个图像中的运动区域位置,从而可以针对运动区域位置和非运动区域位置,更准确地提取每个原始图像所需的子图像特征,提高图像处理的准确性。In this embodiment, the electronic device can obtain the motion area mask of each non-reference frame except the reference frame in at least two original images, and determine the motion area position in each image based on the reference frame, the non-reference frame and the corresponding motion area mask, so as to more accurately extract the sub-image features required for each original image with respect to the motion area position and the non-motion area position, thereby improving the accuracy of image processing.

并且,运动区域掩码用于提高运动区域的降噪程度。可以理解的是,联合去噪、解马赛克与超分辨率网络倾向于使用多帧信息进行去噪,因为噪声一般是零均值的,帧数越多平均后去噪的能力越强。但各个非参考帧中运动区域为参考帧的运动区域,也即运动区域使用了一帧信息,因此,联合去噪、解马赛克与超分辨率网络会隐式地提升运动区域的降噪程度,避免出现拼接伪影。In addition, the motion region mask is used to improve the degree of noise reduction in the motion region. It is understandable that the joint denoising, demosaicing and super-resolution network tends to use multi-frame information for denoising, because noise is generally zero-mean, and the more frames there are, the stronger the denoising ability after averaging. However, the motion region in each non-reference frame is the motion region of the reference frame, that is, the motion region uses one frame of information. Therefore, the joint denoising, demosaicing and super-resolution network will implicitly improve the degree of noise reduction in the motion region to avoid splicing artifacts.

在一个实施例中,参考帧的噪声信息的确定方式,包括:基于参考帧的拍摄参数,确定参考帧对应的散粒噪声和读出噪声;基于参考帧对应的散粒噪声和读出噪声,生成参考帧的目标噪声图;目标噪声图包含参考帧的噪声信息。In one embodiment, a method for determining noise information of a reference frame includes: determining shot noise and readout noise corresponding to the reference frame based on shooting parameters of the reference frame; generating a target noise map of the reference frame based on the shot noise and readout noise corresponding to the reference frame; the target noise map includes noise information of the reference frame.

散粒噪声(shot noise)是通信设备中的有源器件(如电真空管)中,由于电子发射不均匀性所引起的噪声。读出噪声(read noise)是在将像素中的电荷转移出相机过程中电子学产生的噪声,是将每个像素的电荷转换为信号,并将其转换为数字值时,系统组件产生的所有噪声的组合,如电荷转移噪声、读出放大器复位噪声、模拟-数字转换量化噪声、行转移时钟和水平寄存器驱动时钟之间的串扰导致的噪声等。Shot noise is the noise caused by the non-uniformity of electron emission in active devices (such as vacuum tubes) in communication equipment. Read noise is the noise generated by the electronics in the process of transferring the charge in the pixel out of the camera. It is the combination of all the noise generated by the system components when converting the charge of each pixel into a signal and converting it into a digital value, such as charge transfer noise, read amplifier reset noise, analog-to-digital conversion quantization noise, and noise caused by crosstalk between the line transfer clock and the horizontal register drive clock.

参考帧的拍摄参数可以包括感光度(ISO),还可以包括快门时长或光圈值等信息。The shooting parameters of the reference frame may include sensitivity (ISO), and may also include information such as shutter time or aperture value.

可选地,电子设备将参考帧的拍摄参数输入噪声模型,通过噪声模型输出参考帧的拍摄参数对应的散粒噪声和读出噪声。其中,噪声模型可以是高斯-泊松噪声模型。可以理解的是,由于拍摄过程中不同的数字增益(digital gain)设置会影响到拍摄的噪声强度,因此预先对图像传感器进行标定得到噪声模型。Optionally, the electronic device inputs the shooting parameters of the reference frame into the noise model, and outputs the shot noise and readout noise corresponding to the shooting parameters of the reference frame through the noise model. The noise model may be a Gaussian-Poisson noise model. It is understandable that since different digital gain settings during the shooting process will affect the noise intensity of the shooting, the image sensor is calibrated in advance to obtain the noise model.

可选地,基于参考帧对应的散粒噪声和读出噪声,生成参考帧的目标噪声图,包括:将参考帧中各像素分别乘以散粒噪声,得到中间噪声图;将中间噪声图加上读出噪声,生成参考帧的目标噪声图。Optionally, based on the shot noise and readout noise corresponding to the reference frame, a target noise map of the reference frame is generated, including: multiplying each pixel in the reference frame by the shot noise to obtain an intermediate noise map; and adding the readout noise to the intermediate noise map to generate a target noise map of the reference frame.

电子设备将参考帧中各像素分别乘以散粒噪声的噪声值,得到中间噪声图;将中间噪声图中各像素分别加上读出噪声的噪声值,生成参考帧的目标噪声图。其中,目标噪声图中每个像素值表示参考帧对应位置像素的噪声信息。The electronic device multiplies each pixel in the reference frame by the noise value of the shot noise to obtain an intermediate noise map, and adds the noise value of the readout noise to each pixel in the intermediate noise map to generate a target noise map of the reference frame. Each pixel value in the target noise map represents the noise information of the pixel at the corresponding position of the reference frame.

在本实施例中,电子设备基于参考帧的拍摄参数,确定参考帧对应的散粒噪声和读出噪声,基于参考帧对应的散粒噪声和读出噪声,可以准确地生成参考帧的目标噪声图,从而得到从目标噪声图获得参考帧的噪声信息。In this embodiment, the electronic device determines the shot noise and readout noise corresponding to the reference frame based on the shooting parameters of the reference frame, and can accurately generate a target noise map of the reference frame based on the shot noise and readout noise corresponding to the reference frame, thereby obtaining the noise information of the reference frame from the target noise map.

在一个实施例中,如图4所示,电子设备获取至少两个原始图像(Low QualityImage,低质量的输入图像),以及每个原始图像的运动区域掩码,将每个原始图像和各自的运动区域掩码在通道维度上进行串联,得到新的原始图像;提取至少两个新的原始图像中每个新的原始图像的子图像特征;通过卷积层或自注意力机制将至少两个子图像特征进行融合,得到第一图像特征;基于参考帧的拍摄参数,确定参考帧对应的散粒噪声和读出噪声;基于至少两个原始图像中参考帧对应的散粒噪声和读出噪声,生成参考帧的目标噪声图;将目标噪声图和第一图像特征输入JDD(Joint Demosaic and Denoising,联合解马赛克去噪)模块中,通过JDD模块基于参考帧的目标噪声图,对第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;其中,JDD模块包括UResNet网络结构和2倍上采样;对第二图像特征进行预设倍率的上采样,得到上采样后第二图像特征,该上采样后第二图像特征为低频分量;将第二图像特征输入SR(Super-Resolution,超分辨率)模块中,通过SR模块对第二图像特征进行超分辨率处理,得到第三图像特征,该第三图像特征为高频分量;其中,超分辨率处理包括预设倍率的上采样;将上采样后第二图像特征和第三图像特征相加,生成目标图像。In one embodiment, as shown in FIG. 4 , the electronic device obtains at least two original images (Low Quality Image, low-quality input images) and a motion region mask of each original image, concatenates each original image and the respective motion region mask in the channel dimension to obtain a new original image; extracts sub-image features of each new original image in the at least two new original images; fuses at least two sub-image features through a convolutional layer or a self-attention mechanism to obtain a first image feature; determines shot noise and readout noise corresponding to the reference frame based on shooting parameters of the reference frame; generates a target noise map of the reference frame based on the shot noise and readout noise corresponding to the reference frame in the at least two original images; inputs the target noise map and the first image feature into a JDD (Joint Demosaic and In a joint demosaicing and denoising) module, a denoising process and a demosaicing process are performed on a first image feature based on a target noise map of a reference frame through a JDD module to obtain a second image feature; wherein the JDD module includes a UResNet network structure and 2x upsampling; the second image feature is upsampled at a preset ratio to obtain an upsampled second image feature, and the upsampled second image feature is a low-frequency component; the second image feature is input into an SR (Super-Resolution) module, and a super-resolution process is performed on the second image feature through the SR module to obtain a third image feature, and the third image feature is a high-frequency component; wherein the super-resolution process includes upsampling at a preset ratio; the upsampled second image feature and the third image feature are added to generate a target image.

在一个实施例中,如图5所示,提供了另一种图像处理方法,包括以下步骤:In one embodiment, as shown in FIG5 , another image processing method is provided, comprising the following steps:

步骤S502,对至少两个原始图像中除参考帧之外的非参考帧进行运动检测,确定每个非参考帧的运动区域。Step S502 : performing motion detection on non-reference frames other than the reference frame in at least two original images to determine a motion region of each non-reference frame.

可选地,电子设备采用运动检测算法对至少两个原始图像中除参考帧之外的非参考帧进行运动检测,确定每个非参考帧的运动区域。Optionally, the electronic device uses a motion detection algorithm to perform motion detection on non-reference frames other than the reference frame in at least two original images to determine a motion region of each non-reference frame.

可选地,电子设备将至少两个原始图像中除参考帧之外的非参考帧分别和参考帧进行差值处理,得到每个非参考帧对应的差值图像;从每个非参考帧对应的差值图像中确定每个非参考帧的运动区域。Optionally, the electronic device performs difference processing on non-reference frames other than the reference frame in at least two original images and the reference frame to obtain a difference image corresponding to each non-reference frame; and determines the motion area of each non-reference frame from the difference image corresponding to each non-reference frame.

针对每个非参考帧对应的差值图像,电子设备可以将差值图像中各个像素值与预设阈值进行比较,将像素值大于预设阈值的像素作为运动像素,并将各个运动像素构成非参考帧的运动区域。其中,预设阈值可以根据需要进行设置。For the difference image corresponding to each non-reference frame, the electronic device can compare each pixel value in the difference image with a preset threshold, take pixels with pixel values greater than the preset threshold as motion pixels, and form the motion region of the non-reference frame with each motion pixel. The preset threshold can be set as needed.

可选地,为了提升图像处理效率,电子设备可以将至少两个原始图像进行降采样,对降采样后至少两个原始图像中除参考帧之外的非参考帧进行运动检测,确定每个非参考帧的运动区域。Optionally, in order to improve image processing efficiency, the electronic device may downsample at least two original images, perform motion detection on non-reference frames other than the reference frame in the at least two original images after downsampling, and determine the motion region of each non-reference frame.

步骤S504,基于参考帧的图像信息,更新每个非参考帧的运动区域,得到更新后非参考帧。Step S504: based on the image information of the reference frame, update the motion region of each non-reference frame to obtain an updated non-reference frame.

可选地,电子设备可以基于参考帧中对应于非参考帧的运动区域位置的图像信息,更新每个非参考帧的运动区域,得到更新后非参考帧。Optionally, the electronic device may update the motion region of each non-reference frame based on image information of the motion region position corresponding to the non-reference frame in the reference frame to obtain an updated non-reference frame.

在一种可选的实施方式中,针对每个非参考帧,将非参考帧的运动区域,替换为参考帧中对应于非参考帧的运动区域位置的图像信息,得到更新后非参考帧。In an optional implementation, for each non-reference frame, the motion region of the non-reference frame is replaced with image information of the reference frame corresponding to the position of the motion region of the non-reference frame to obtain an updated non-reference frame.

在另一种可选的实施方式中,针对每个非参考帧,将参考帧中对应于非参考帧的运动区域位置的图像信息,覆盖非参考帧的运动区域,得到更新后非参考帧。In another optional implementation, for each non-reference frame, the image information of the motion region position corresponding to the non-reference frame in the reference frame is used to cover the motion region of the non-reference frame to obtain an updated non-reference frame.

步骤S506,以参考帧和更新后非参考帧作为新的至少两个原始图像,基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;第二图像特征的频率低于预设频率阈值。Step S506, using the reference frame and the updated non-reference frame as at least two new original images, based on the noise information of the reference frame in the at least two original images, denoising and demosaicing the first image features extracted from the at least two original images to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold.

电子设备基于新的至少两个原始图像中参考帧的噪声信息,对从新的至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征。The electronic device performs denoising and demosaicing processing on the first image features extracted from the new at least two original images based on the noise information of the reference frame in the new at least two original images to obtain the second image features.

步骤S508,对第二图像特征进行超分辨率处理,得到第三图像特征;第三图像特征的频率高于或等于预设频率阈值。Step S508: perform super-resolution processing on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold.

步骤S510,根据第二图像特征和第三图像特征,生成目标图像。Step S510: Generate a target image according to the second image feature and the third image feature.

可以理解的是,由于至少两个原始图像之间的拍摄时刻存在间隔,被拍摄对象不可避免会产生自主运动,运动较大时多帧配准在运动区域会失效,则在多帧图像融合后会出现运动鬼影等问题。It is understandable that since there is a gap between the shooting times of at least two original images, the photographed object will inevitably have autonomous movement. When the movement is large, multi-frame registration will fail in the moving area, and problems such as motion ghosting will appear after the multi-frame images are fused.

而在本实施例中,电子设备对至少两个原始图像中除参考帧之外的非参考帧进行运动检测,确定每个非参考帧的运动区域;基于参考帧的图像信息,更新每个非参考帧的运动区域,得到更新后非参考帧,可以避免图像融合后出现鬼影等问题,并且消除多帧间的较大位移,提高图像处理的准确性。In the present embodiment, the electronic device performs motion detection on non-reference frames other than the reference frame in at least two original images, and determines the motion area of each non-reference frame; based on the image information of the reference frame, the motion area of each non-reference frame is updated to obtain an updated non-reference frame, which can avoid problems such as ghosting after image fusion, eliminate large displacements between multiple frames, and improve the accuracy of image processing.

在一个实施例中,如图6所示,提供了另一种图像处理方法,包括以下步骤:In one embodiment, as shown in FIG6 , another image processing method is provided, comprising the following steps:

步骤S602,将至少两个原始图像中除参考帧之外的非参考帧,向参考帧进行配准,得到配准后非参考帧。Step S602: registering non-reference frames other than the reference frame in at least two original images with the reference frame to obtain a registered non-reference frame.

可选地,电子设备将非参考帧向参考帧进行配准,具体可以包括位移、插值等操作,还可以包括亮度对齐、图像块对齐等操作。Optionally, the electronic device aligns the non-reference frame with the reference frame, which may specifically include operations such as displacement and interpolation, and may also include operations such as brightness alignment and image block alignment.

可选地,将至少两个原始图像中除参考帧之外的非参考帧,向参考帧进行配准,得到配准后非参考帧,包括:基于参考帧和至少两个原始图像中除参考帧之外的非参考帧,确定参考帧和每个非参考帧之间的运动变换关系;基于每个非参考帧对应的运动变换关系向参考帧进行配准,得到配准后非参考帧。Optionally, non-reference frames other than the reference frame in at least two original images are aligned with the reference frame to obtain aligned non-reference frames, including: determining a motion transformation relationship between the reference frame and each non-reference frame based on the reference frame and the non-reference frames other than the reference frame in at least two original images; and aligning each non-reference frame with the reference frame based on the motion transformation relationship corresponding to the non-reference frame to obtain aligned non-reference frames.

其中,运动变换关系包括仿射变换矩阵和特征点光流中的至少一种。The motion transformation relationship includes at least one of an affine transformation matrix and a feature point optical flow.

可选地,为了提高图像处理效率,电子设备将参考帧和至少两个原始图像中除参考帧之外的非参考帧进行切块,得到参考帧的各个图像块和至少两个原始图像中除参考帧之外的非参考帧的各个图像块;对参考帧各个图像块和非参考帧各个图像块分别进行角点检测,得到参考帧每个图像块的参考特征点和非参考帧每个图像块的非参考特征点;针对每个非参考帧中每个图像块,电子设备确定非参考帧的图像块中非参考特征点和参考帧对应位置图像块的参考特征点之间的运动变换关系,并将非参考帧的图像块按照该运动变换关系向参考帧对应位置图像块进行配准;基于非参考帧中各个配准后的图像块,得到配准后非参考帧。Optionally, in order to improve image processing efficiency, the electronic device cuts the reference frame and the non-reference frames other than the reference frame in at least two original images into blocks to obtain individual image blocks of the reference frame and individual image blocks of the non-reference frames other than the reference frame in at least two original images; performs corner point detection on each image block of the reference frame and each image block of the non-reference frame to obtain reference feature points of each image block of the reference frame and non-reference feature points of each image block of the non-reference frame; for each image block in each non-reference frame, the electronic device determines the motion transformation relationship between the non-reference feature points in the image block of the non-reference frame and the reference feature points of the image block at the corresponding position of the reference frame, and aligns the image block of the non-reference frame to the image block at the corresponding position of the reference frame according to the motion transformation relationship; based on each aligned image block in the non-reference frame, an aligned non-reference frame is obtained.

可选地,针对每个非参考帧中每个图像块,电子设备确定非参考帧的图像块中非参考特征点和参考帧对应位置图像块的参考特征点之间的仿射变换矩阵或特征点光流,将非参考帧的图像块乘以该仿射变换矩阵或特征点光流,得到非参考帧中配准后图像块,准确地向参考帧对应位置图像块进行配准。Optionally, for each image block in each non-reference frame, the electronic device determines an affine transformation matrix or feature point optical flow between non-reference feature points in the image block of the non-reference frame and reference feature points in the image block at a corresponding position in the reference frame, multiplies the image block of the non-reference frame by the affine transformation matrix or feature point optical flow, obtains the registered image block in the non-reference frame, and accurately aligns it to the image block at a corresponding position in the reference frame.

可选地,电子设备可以对相邻图像块进行平滑滤波处理,再将平滑滤波处理后的各个图像块拼接得到配准后非参考帧,则该配准后非参考帧中相邻图像块之间的过渡区域更加自然。Optionally, the electronic device may perform smoothing filtering on adjacent image blocks, and then splice the image blocks after the smoothing filtering to obtain a registered non-reference frame, so that the transition area between adjacent image blocks in the registered non-reference frame is more natural.

可选地,电子设备在切块时得到的各个相邻图像块存在重合像素,将相邻图像块的重合像素融合,得到配准后非参考帧,则该配准后非参考帧中相邻图像块之间的过渡区域更加自然。Optionally, adjacent image blocks obtained by the electronic device during slicing have overlapping pixels, and the overlapping pixels of the adjacent image blocks are fused to obtain a registered non-reference frame, so that the transition area between adjacent image blocks in the registered non-reference frame is more natural.

步骤S604,对至少两个原始图像中除参考帧之外的非参考帧进行运动检测,确定每个非参考帧的运动区域。Step S604: performing motion detection on non-reference frames other than the reference frame in at least two original images to determine a motion region of each non-reference frame.

步骤S606,基于参考帧的图像信息,更新每个配准后非参考帧的运动区域,得到更新后非参考帧。Step S606: based on the image information of the reference frame, update the motion region of each registered non-reference frame to obtain an updated non-reference frame.

针对每个非参考帧,电子设备将配准后非参考帧的运动区域,替换为参考帧中对应于非参考帧的运动区域位置的图像信息,得到更新后非参考帧。For each non-reference frame, the electronic device replaces the motion region of the registered non-reference frame with the image information of the reference frame corresponding to the position of the motion region of the non-reference frame to obtain an updated non-reference frame.

步骤S608,以参考帧和更新后非参考帧作为新的至少两个原始图像,基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;第二图像特征的频率低于预设频率阈值。Step S608, using the reference frame and the updated non-reference frame as at least two new original images, based on the noise information of the reference frame in the at least two original images, denoising and demosaicing the first image features extracted from the at least two original images to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold.

步骤S610,对第二图像特征进行超分辨率处理,得到第三图像特征;第三图像特征的频率高于或等于预设频率阈值。Step S610, super-resolution processing is performed on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold.

步骤S612,根据第二图像特征和第三图像特征,生成目标图像。Step S612: Generate a target image according to the second image feature and the third image feature.

可以理解的是,在电子设备拍摄至少两个原始图像的过程中,原始图像之间存在整体位移或局部位移,具体可以包括电子设备本身的位移或者被拍摄物体的局部位移等在短时间内带来的图像整体偏移的情况。因此,电子设备将至少两个原始图像中除参考帧之外的非参考帧向参考帧进行配准,可以在后续将多个图像特征更准确地进行融合,提高图像处理的准确性。It is understandable that, in the process of the electronic device capturing at least two original images, there is an overall displacement or a partial displacement between the original images, which may specifically include the displacement of the electronic device itself or the partial displacement of the captured object, etc., which may cause the overall displacement of the image in a short period of time. Therefore, the electronic device aligns the non-reference frames other than the reference frame in the at least two original images with the reference frame, and can subsequently fuse multiple image features more accurately, thereby improving the accuracy of image processing.

电子设备以高精度高效率的配准对齐模块,可以通过多帧间的亚像素级互补信息来恢复传统单帧算法难以得到的细节,同时多帧信息的有效利用可以极大地提升图像去噪能力。并且,对于多帧输入,高精度运动区域检测模块及非参考帧运动区域替换为参考帧的运动区域,可以有效地避免因拍摄物体运动导致的鬼影问题。Electronic devices use high-precision and high-efficiency registration and alignment modules to restore details that are difficult to obtain with traditional single-frame algorithms through sub-pixel complementary information between multiple frames. At the same time, the effective use of multi-frame information can greatly improve image denoising capabilities. In addition, for multi-frame input, the high-precision motion region detection module and the replacement of non-reference frame motion regions with reference frame motion regions can effectively avoid ghosting problems caused by the motion of the captured object.

在一个实施例中,从至少两个原始图像中确定参考帧,包括:确定至少两个原始图像中每个原始图像的清晰度;基于每个原始图像的清晰度,从至少两个原始图像中确定参考帧。In one embodiment, determining a reference frame from at least two original images includes: determining the clarity of each of the at least two original images; and determining the reference frame from the at least two original images based on the clarity of each original image.

可选地,电子设备从至少两个原始图像中确定清晰度最高的原始图像确定为参考帧。Optionally, the electronic device determines an original image with the highest definition from at least two original images as a reference frame.

可选地,电子设备从至少两个原始图像中确定清晰度次高的原始图像确定为参考帧。Optionally, the electronic device determines an original image with the second highest definition from at least two original images as a reference frame.

需要说明的是,从至少两个原始图像中确定参考帧的方式并不限定。It should be noted that the method of determining the reference frame from at least two original images is not limited.

可选地,确定至少两个原始图像中每个原始图像的清晰度,包括:针对每个RAW域的原始图像,将RAW域的原始图像中绿色通道进行平均处理,生成灰度图;从灰度图中提取高斯差算子;基于高斯差算子,确定原始图像的清晰度。Optionally, determining the clarity of each of the at least two original images includes: for each original image in the RAW domain, averaging the green channel of the original image in the RAW domain to generate a grayscale image; extracting a Gaussian difference operator from the grayscale image; and determining the clarity of the original image based on the Gaussian difference operator.

可选地,针对每个RAW域的原始图像,电子设备将RAW域的原始图像中2个绿色通道进行平均处理,生成灰度图;从该灰度图中提取高斯差算子(DoG,Difference ofGaussian);基于高斯差算子,确定原始图像的清晰度。Optionally, for each original image in the RAW domain, the electronic device averages two green channels in the original image in the RAW domain to generate a grayscale image; extracts a Difference of Gaussian (DoG) operator from the grayscale image; and determines the clarity of the original image based on the Difference of Gaussian operator.

可选地,基于高斯差算子,确定原始图像的清晰度,包括:将高斯差算子中包括的各个元素进行平均,得到原始图像的清晰度。其中,高斯差算子中的元素包括高斯核的尺寸和方差,可以通过对图像数据的分析统计得到。Optionally, determining the clarity of the original image based on a Gaussian difference operator includes: averaging the elements included in the Gaussian difference operator to obtain the clarity of the original image. The elements in the Gaussian difference operator include the size and variance of the Gaussian kernel, which can be obtained by analyzing and statistically analyzing the image data.

高斯差算子中,高斯核的尺寸和方差等参数根据数据分布进行调整后固定,也就是说,统计高斯核的尺寸和方差等参数的整体分布,根据该参数的整体分布,确定一组高斯核的尺寸和方差,使其符合该参数的数据整体分布,高斯核的尺寸和方差等参数随后固定不变。In the Gaussian difference operator, parameters such as the size and variance of the Gaussian kernel are fixed after being adjusted according to the data distribution. That is to say, the overall distribution of parameters such as the size and variance of the Gaussian kernel is statistically analyzed. Based on the overall distribution of the parameters, a set of sizes and variances of Gaussian kernels are determined to make them conform to the overall distribution of the data of the parameters. The parameters such as the size and variance of the Gaussian kernel are then fixed.

可选地,电子设备可以将该高斯差算子的平均值作为原始图像的清晰度,也可以将该高斯差算子的平均值作为原始图像的清晰度评分,按照各个原始图像的清晰度评分确定各个原始图像的清晰度排序。其中,高斯差算子是一个图像长*图像宽的矩阵,对该矩阵的所有元素参数进行平均得到,作为清晰度评分。清晰度评分最高,也即对应的原始图像的清晰度最高。Optionally, the electronic device can use the average value of the Gaussian difference operator as the clarity of the original image, or use the average value of the Gaussian difference operator as the clarity score of the original image, and determine the clarity ranking of each original image according to the clarity score of each original image. The Gaussian difference operator is a matrix of image length*image width, and all element parameters of the matrix are averaged to obtain the clarity score. The highest clarity score means that the corresponding original image has the highest clarity.

可以理解的是,由于RAW域的原始图像中,绿色通道采样率高且人眼对其更敏感,绿通道承载的信息更多,因此,将RAW域的原始图像中2个绿色通道进行平均处理,可以得到信息更多的灰度图,从而可以更准确地确定出原始图像的清晰度。It is understandable that, since in the original image in the RAW domain, the green channel has a high sampling rate and the human eye is more sensitive to it, the green channel carries more information. Therefore, averaging the two green channels in the original image in the RAW domain can obtain a grayscale image with more information, thereby more accurately determining the clarity of the original image.

电子设备获取Raw域原始图像,可以最大限度地保留拍摄时图像传感器接收到的图像信号,避免因前序传统算法如传统解马赛克、去噪、色调映射等对图像细节信息、结构信息、色彩亮度信息等的破坏,同时可以避免图像动态范围压缩等带来的信息损失,相对于传统的YUV域或RGB域图像,具有更大的宽容度以及更好的视觉效果。Electronic devices acquire original images in the Raw domain, which can retain the image signal received by the image sensor during shooting to the maximum extent, avoiding the destruction of image detail information, structural information, color brightness information, etc. caused by previous traditional algorithms such as traditional demosaicing, denoising, tone mapping, etc. At the same time, it can avoid information loss caused by image dynamic range compression, etc. Compared with traditional YUV domain or RGB domain images, it has greater tolerance and better visual effects.

在一个实施例中,如图7所示,电子设备通过镜头模组的图像传感器进行拍摄,并转储(dump)至少两个原始图像;计算每个原始图像的清晰度,按照清晰度排序,去掉清晰度低的原始图像,得到剩下的原始图像;从剩下的原始图像中确定参考帧和非参考帧;对参考帧和非参考帧分别进行切块与提取特征点,计算参考帧和非参考帧之间的光流或仿射变换矩阵;基于光流或仿射变换矩阵,将非参考帧向参考帧配准;对各个非参考帧进行运动区域检测,确定各个非参考帧的运动区域掩码;基于各个非参考帧的运动区域掩码,将配准后非参考帧运动区域替换为参考帧像素,得到待输入网络的多帧图像。其中,镜头模组可以是长焦模组,网络指的是联合解马赛克、去噪、超分辨率网络。In one embodiment, as shown in FIG7 , the electronic device shoots through the image sensor of the lens module and dumps at least two original images; calculates the clarity of each original image, sorts them according to the clarity, removes the original images with low clarity, and obtains the remaining original images; determines the reference frame and the non-reference frame from the remaining original images; cuts and extracts feature points from the reference frame and the non-reference frame respectively, and calculates the optical flow or affine transformation matrix between the reference frame and the non-reference frame; aligns the non-reference frame to the reference frame based on the optical flow or affine transformation matrix; performs motion region detection on each non-reference frame to determine the motion region mask of each non-reference frame; based on the motion region mask of each non-reference frame, replaces the motion region of the non-reference frame after alignment with the reference frame pixel, and obtains multiple frames of images to be input into the network. Among them, the lens module can be a telephoto module, and the network refers to a joint demosaicing, denoising, and super-resolution network.

在一个实施例中,上述方法还包括:将第二图像特征映射至RGB域,以及将第三图像特征映射至RGB域;根据第二图像特征和第三图像特征,生成目标图像,包括:将RGB域的第二图像特征和RGB域的第三图像特征相加,生成目标图像。In one embodiment, the above method also includes: mapping the second image feature to the RGB domain, and mapping the third image feature to the RGB domain; generating a target image based on the second image feature and the third image feature, including: adding the second image feature in the RGB domain and the third image feature in the RGB domain to generate the target image.

可选地,电子设备将第二图像特征输入两个卷积层,通过两个卷积层将第二图像特征映射至RGB域,得到RGB域的第二图像特征;将第三图像特征输入两个卷积层,通过两个卷积层将第三图像特征映射至RGB域,得到RGB域的第三图像特征;将RGB域的第二图像特征和RGB域的第三图像特征相加,生成RGB域的目标图像。Optionally, the electronic device inputs the second image feature into two convolutional layers, maps the second image feature to the RGB domain through the two convolutional layers, and obtains the second image feature in the RGB domain; inputs the third image feature into two convolutional layers, maps the third image feature to the RGB domain through the two convolutional layers, and obtains the third image feature in the RGB domain; adds the second image feature in the RGB domain and the third image feature in the RGB domain to generate a target image in the RGB domain.

在本实施例中,电子设备将第二图像特征和第三图像特征均映射至RGB域,可以准确地生成RGB域的目标图像。In this embodiment, the electronic device maps both the second image feature and the third image feature to the RGB domain, and can accurately generate a target image in the RGB domain.

在一个实施例中,上述方法还包括:在锁定拍摄参数的情况下,拍摄得到至少两个原始图像。In one embodiment, the method further includes: capturing and obtaining at least two original images while locking the shooting parameters.

可选地,拍摄参数包括自动曝光参数(AE,Automatic Exposure)、自动对焦参数(AF,Auto Focus)或自动白平衡参数(AWB,Automatic White Balance)等。拍摄参数还包括感光度、快门时长等,不限于此。Optionally, the shooting parameters include automatic exposure parameters (AE, Automatic Exposure), automatic focus parameters (AF, Auto Focus) or automatic white balance parameters (AWB, Automatic White Balance), etc. The shooting parameters also include sensitivity, shutter time, etc., but are not limited thereto.

可选地,电子设备在锁定拍摄参数的情况下,针对同一个拍摄场景连续拍摄得到至少两个原始图像。Optionally, the electronic device continuously captures the same shooting scene to obtain at least two original images while locking the shooting parameters.

可以理解的是,电子设备在连续拍摄过程中以队列存储各帧原始图像,当用户触发快门时,从寄存器中向前获取至少两个原始图像。It is understandable that the electronic device stores each frame of the original image in a queue during the continuous shooting process, and when the user triggers the shutter, at least two original images are obtained from the register.

可选地,为避免电子设备在拍摄过程中运动、或拍摄物体运动带来的大位移,电子设备可以控制快门时长小于或等于预设快门时长。其中,预设快门时长可以根据需要进行设置,预设快门时长也即电子设备在拍摄过程中的最大快门时长。Optionally, to avoid large displacement caused by the movement of the electronic device during shooting or the movement of the object being shot, the electronic device can control the shutter duration to be less than or equal to a preset shutter duration. The preset shutter duration can be set as needed, and the preset shutter duration is also the maximum shutter duration of the electronic device during shooting.

在本实施例中,电子设备在锁定拍摄参数的情况下,拍摄得到至少两个原始图像,可以使得拍摄得到的至少两个原始图像保持亮度、色彩等图像特征的一致性,从而提高后续图像处理的准确性。In this embodiment, the electronic device captures at least two original images while locking the shooting parameters, so that the at least two original images captured can maintain consistency in image features such as brightness and color, thereby improving the accuracy of subsequent image processing.

在一个实施例中,如图8所示,电子设备拍摄并转储多个RAW图,RAW图的数量可以是N;从多个RAW图中选帧,即选择参考帧和非参考帧,电子设备可以计算各个RAW图的清晰度,按照清晰度排序并选出清晰度最高的参考帧和其他非参考帧(总数小于N);将非参考帧向参考帧进行配准得到配准后的RAW图,配准后的RAW图包括参考帧和各个配准后的非参考帧;计算非参考帧相对于参考帧的运动区域掩码;根据运动区域掩码将非参考帧的运动区域替换为参考帧对应位置的图像信息后,将各个图像与运动区域掩码串联起来,送入特征提取网络提取每个图像的特征,得到第一图像特征;根据预先标定的传感器噪声模型,获取参考帧的目标噪声图,与第一图像特征串联后输入联合去噪、解马赛克与超分辨率网络,最终得到一张目标图像。该目标图像可以输入后续的图像处理引擎进行处理。In one embodiment, as shown in FIG8 , an electronic device shoots and dumps multiple RAW images, the number of which may be N; selects frames from the multiple RAW images, i.e., selects reference frames and non-reference frames, and the electronic device may calculate the clarity of each RAW image, sorts them according to the clarity, and selects the reference frame and other non-reference frames (the total number is less than N) with the highest clarity; aligns the non-reference frame to the reference frame to obtain an aligned RAW image, the aligned RAW image includes the reference frame and each aligned non-reference frame; calculates the motion region mask of the non-reference frame relative to the reference frame; replaces the motion region of the non-reference frame with the image information of the corresponding position of the reference frame according to the motion region mask, connects each image with the motion region mask in series, and sends them to a feature extraction network to extract the features of each image, and obtains a first image feature; obtains a target noise image of the reference frame according to a pre-calibrated sensor noise model, and inputs it into a joint denoising, demosaicing and super-resolution network after being connected in series with the first image feature, and finally obtains a target image. The target image may be input into a subsequent image processing engine for processing.

在一个实施例中,根据不同场景下对图像细节、涂抹感等的优化需求,电子设备还可以支持对参考帧进行锐化,以及调节纹理时的噪声图,从而可以控制去噪力度、对JDD模块的输出结果叠灰度噪声等操作。In one embodiment, according to the optimization requirements for image details, smearing, etc. in different scenarios, the electronic device can also support sharpening of the reference frame and adjusting the noise map when the texture is adjusted, so as to control the denoising intensity, superimpose grayscale noise on the output result of the JDD module, and other operations.

可选地,电子设备对输入的Raw域原始图像中的参考帧进行锐化,可以使联合去噪、解马赛克与超分辨率网络在处理时保留更多的弱纹理,降低涂抹感,同时避免在RGB域或YUV域锐化时导致的黑白边等伪影。Optionally, the electronic device sharpens the reference frame in the input Raw domain original image, so that the joint denoising, demosaicing and super-resolution network can retain more weak textures during processing, reduce the smearing effect, and avoid artifacts such as black and white edges caused by sharpening in the RGB domain or YUV domain.

可选地,联合去噪、解马赛克与超分辨率网络的去噪力度受参考帧的目标噪声图的影响。通过调节推理时输入到该联合去噪、解马赛克与超分辨率网络的目标噪声图,可以控制该联合去噪、解马赛克与超分辨率网络的去噪强度,在涂抹感与带噪之间获得平衡。Optionally, the denoising strength of the joint denoising, demosaicing and super-resolution network is affected by the target noise map of the reference frame. By adjusting the target noise map input to the joint denoising, demosaicing and super-resolution network during inference, the denoising strength of the joint denoising, demosaicing and super-resolution network can be controlled to achieve a balance between smearing and noise.

另外,联合去噪、解马赛克与超分辨率网络可以对图像的全局或局部调节去噪强度。例如,对于夜景拍摄的图像,电子设备可以控制联合去噪、解马赛克与超分辨率网络整体提升去噪强度;对于白天拍摄的图像,电子设备可以控制联合去噪、解马赛克与超分辨率网络判断出图像的暗区,对暗区提升去噪强度。In addition, the joint denoising, demosaicing and super-resolution network can adjust the denoising strength of the image globally or locally. For example, for images taken at night, the electronic device can control the joint denoising, demosaicing and super-resolution network to improve the denoising strength as a whole; for images taken during the day, the electronic device can control the joint denoising, demosaicing and super-resolution network to determine the dark area of the image and improve the denoising strength of the dark area.

可选地,由于人眼感知的特殊性,颗粒状的灰度噪声在纹理区域可以提升视觉质量。电子设备可以将JDD模块与SR模块解耦,实现原始图像噪声在JDD模块输出上的回叠,降低涂抹感。Optionally, due to the particularity of human eye perception, granular grayscale noise can improve visual quality in texture areas. The electronic device can decouple the JDD module from the SR module to achieve the overlap of the original image noise on the JDD module output to reduce the smearing effect.

在一个实施例中,还提供了一种图像处理方法,包括以下步骤:In one embodiment, an image processing method is also provided, comprising the following steps:

步骤A1,在锁定拍摄参数的情况下,拍摄得到至少两个原始图像。Step A1: Under the condition of locking the shooting parameters, at least two original images are captured.

步骤A2,针对每个RAW域的原始图像,将RAW域的原始图像中绿色通道进行平均处理,生成灰度图;从灰度图中提取高斯差算子;将高斯差算子中包括的各个元素进行平均,得到原始图像的清晰度。。Step A2: for each original image in the RAW domain, average the green channel in the original image in the RAW domain to generate a grayscale image; extract a Gaussian difference operator from the grayscale image; average each element included in the Gaussian difference operator to obtain the clarity of the original image.

步骤A3,基于每个原始图像的清晰度,从至少两个原始图像中确定参考帧。Step A3, determining a reference frame from at least two original images based on the definition of each original image.

步骤A4,基于参考帧和至少两个原始图像中除参考帧之外的非参考帧,确定参考帧和每个非参考帧之间的运动变换关系;基于每个非参考帧对应的运动变换关系向参考帧进行配准,得到配准后非参考帧;运动变换关系包括仿射变换矩阵和特征点光流中的至少一种。Step A4, based on the reference frame and non-reference frames other than the reference frame in at least two original images, determine the motion transformation relationship between the reference frame and each non-reference frame; based on the motion transformation relationship corresponding to each non-reference frame, align it with the reference frame to obtain the aligned non-reference frame; the motion transformation relationship includes at least one of an affine transformation matrix and a feature point optical flow.

步骤A5,对至少两个原始图像中除参考帧之外的非参考帧进行运动检测,确定每个非参考帧的运动区域。Step A5: performing motion detection on non-reference frames other than the reference frame in at least two original images to determine a motion region of each non-reference frame.

步骤A6,针对每个非参考帧,将配准后非参考帧的运动区域,替换为参考帧中对应于非参考帧的运动区域位置的图像信息,得到更新后非参考帧。Step A6: for each non-reference frame, replace the motion region of the registered non-reference frame with the image information of the reference frame corresponding to the position of the motion region of the non-reference frame to obtain an updated non-reference frame.

步骤A7,以参考帧和更新后非参考帧作为新的至少两个原始图像,获取新的至少两个原始图像中除参考帧之外的每个非参考帧的运动区域掩码;基于参考帧、非参考帧和对应的运动区域掩码,提取每个原始图像的子图像特征。Step A7, taking the reference frame and the updated non-reference frame as the new at least two original images, obtaining the motion area mask of each non-reference frame except the reference frame in the new at least two original images; extracting the sub-image features of each original image based on the reference frame, the non-reference frame and the corresponding motion area mask.

步骤A8,将至少两个子图像特征进行融合,得到第一图像特征。Step A8: Fusing at least two sub-image features to obtain a first image feature.

步骤A9,基于参考帧的拍摄参数,确定参考帧对应的散粒噪声和读出噪声;将参考帧中各像素分别乘以散粒噪声,得到中间噪声图;将中间噪声图加上读出噪声,生成参考帧的目标噪声图;目标噪声图包含参考帧的噪声信息。Step A9, based on the shooting parameters of the reference frame, determine the shot noise and readout noise corresponding to the reference frame; multiply each pixel in the reference frame by the shot noise to obtain an intermediate noise map; add the readout noise to the intermediate noise map to generate a target noise map of the reference frame; the target noise map contains the noise information of the reference frame.

步骤A10,对参考帧的目标噪声图和第一图像特征进行特征映射,得到映射特征。Step A10, performing feature mapping on the target noise map and the first image feature of the reference frame to obtain mapping features.

步骤A11,对映射特征依次进行降采样和上采样,得到上采样特征;上采样特征的分辨率和映射特征的分辨率相同;基于上采样特征和映射特征,得到去噪图像特征;对去噪图像特征进行上采样和残差处理,得到第二图像特征;第二图像特征的频率低于预设频率阈值;将第二图像特征映射至RGB域。Step A11, downsample and upsample the mapping features in sequence to obtain upsampled features; the resolution of the upsampled features is the same as the resolution of the mapping features; based on the upsampled features and the mapping features, a denoised image feature is obtained; the denoised image feature is upsampled and residual processed to obtain a second image feature; the frequency of the second image feature is lower than a preset frequency threshold; the second image feature is mapped to the RGB domain.

步骤A12,对第二图像特征进行残差处理,得到残差处理特征;对残差处理特征进行预设倍率的上采样,得到第三图像特征,将第三图像特征映射至RGB域;第三图像特征的频率高于或等于预设频率阈值。Step A12, performing residual processing on the second image feature to obtain a residual processing feature; performing upsampling on the residual processing feature at a preset ratio to obtain a third image feature, and mapping the third image feature to the RGB domain; the frequency of the third image feature is higher than or equal to a preset frequency threshold.

步骤A13,对RGB域的第二图像特征进行预设倍率的上采样,得到RGB域的上采样后第二图像特征;将RGB域的上采样后第二图像特征和RGB域的第三图像特征相加,生成目标图像。Step A13, upsampling the second image feature in the RGB domain at a preset ratio to obtain the upsampled second image feature in the RGB domain; adding the upsampled second image feature in the RGB domain and the third image feature in the RGB domain to generate a target image.

应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的图像处理方法的图像处理装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个图像处理装置实施例中的具体限定可以参见上文中对于图像处理方法的限定,在此不再赘述。Based on the same inventive concept, the embodiment of the present application also provides an image processing device for implementing the above-mentioned image processing method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image processing device embodiments provided below can refer to the limitations on the image processing method above, and will not be repeated here.

在一个实施例中,如图9所示,提供了一种图像处理装置,包括:第一处理模块902、第二处理模块904和图像生成模块906,其中:In one embodiment, as shown in FIG9 , an image processing device is provided, including: a first processing module 902, a second processing module 904 and an image generating module 906, wherein:

第一处理模块902,用于基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到第二图像特征;第二图像特征的频率低于预设频率阈值。The first processing module 902 is used to perform denoising and demosaicing on the first image features extracted from the at least two original images based on the noise information of the reference frame in the at least two original images to obtain the second image features; the frequency of the second image features is lower than the preset frequency threshold.

第二处理模块904,用于对第二图像特征进行超分辨率处理,得到第三图像特征;第三图像特征的频率高于或等于预设频率阈值。The second processing module 904 is used to perform super-resolution processing on the second image feature to obtain a third image feature; the frequency of the third image feature is higher than or equal to a preset frequency threshold.

图像生成模块906,用于根据第二图像特征和第三图像特征,生成目标图像。The image generation module 906 is used to generate a target image according to the second image feature and the third image feature.

上述图像处理装置,基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理,得到频率低于预设频率阈值的第二图像特征;对第二图像特征进行超分辨率处理,得到频率高于或等于预设频率阈值的第三图像特征;也就是说,通过去噪处理和解马赛克处理可以更准确地得到图像的低频色彩轮廓等信息,且通过超分辨率处理可以更准确地得到图像的高频纹理细节等信息,从而根据第二图像特征和第三图像特征,生成去噪、解马赛克和超分辨率的目标图像,提高了图像处理的准确性。The above-mentioned image processing device, based on the noise information of the reference frame in the at least two original images, performs denoising and demosaicing on the first image feature extracted from the at least two original images to obtain a second image feature with a frequency lower than a preset frequency threshold; and performs super-resolution processing on the second image feature to obtain a third image feature with a frequency higher than or equal to the preset frequency threshold; that is, through the denoising and demosaicing processing, the low-frequency color contour and other information of the image can be more accurately obtained, and through the super-resolution processing, the high-frequency texture details and other information of the image can be more accurately obtained, thereby generating a denoised, demosaiced and super-resolution target image based on the second image feature and the third image feature, thereby improving the accuracy of image processing.

在一个实施例中,上述第一处理模块902还用于基于至少两个原始图像中参考帧的噪声信息,对从至少两个原始图像中提取的第一图像特征进行去噪处理,得到去噪图像特征;对去噪图像特征进行解马赛克处理,得到第二图像特征。In one embodiment, the first processing module 902 is also used to perform denoising processing on the first image features extracted from at least two original images based on the noise information of the reference frame in the at least two original images to obtain denoised image features; and perform demosaicing processing on the denoised image features to obtain second image features.

在一个实施例中,上述第一处理模块902还用于对至少两个原始图像中参考帧的噪声信息和从至少两个原始图像中提取的第一图像特征进行特征映射,得到映射特征;对映射特征进行去噪处理,得到去噪图像特征。In one embodiment, the first processing module 902 is further used to perform feature mapping on the noise information of the reference frame in at least two original images and the first image features extracted from at least two original images to obtain mapping features; and to perform denoising on the mapping features to obtain denoised image features.

在一个实施例中,上述第一处理模块902还用于对映射特征依次进行降采样和上采样,得到上采样特征;上采样特征的分辨率和映射特征的分辨率相同;基于上采样特征和映射特征,得到去噪图像特征。In one embodiment, the first processing module 902 is also used to sequentially downsample and upsample the mapping features to obtain upsampled features; the resolution of the upsampled features is the same as the resolution of the mapping features; and based on the upsampled features and the mapping features, denoised image features are obtained.

在一个实施例中,上述第一处理模块902还用于对去噪图像特征进行上采样和残差处理,得到第二图像特征。In one embodiment, the first processing module 902 is further used to perform up-sampling and residual processing on the denoised image features to obtain second image features.

在一个实施例中,上述第二处理模块904还用于对第二图像特征进行残差处理,得到残差处理特征;对残差处理特征进行上采样,得到第三图像特征。In one embodiment, the second processing module 904 is further configured to perform residual processing on the second image feature to obtain a residual processing feature; and upsample the residual processing feature to obtain a third image feature.

在一个实施例中,上述第二处理模块904还用于对残差处理特征进行预设倍率的上采样,得到第三图像特征;上述第一处理模块902还用于对第二图像特征进行预设倍率的上采样,得到上采样后第二图像特征;上述图像生成模块906还用于根据上采样后第二图像特征和第三图像特征,生成目标图像。In one embodiment, the second processing module 904 is also used to upsample the residual processing features at a preset ratio to obtain a third image feature; the first processing module 902 is also used to upsample the second image features at a preset ratio to obtain the upsampled second image features; the image generation module 906 is also used to generate a target image based on the upsampled second image features and the third image features.

在一个实施例中,上述第一处理模块902还用于从至少两个原始图像中提取每个原始图像的子图像特征;将至少两个子图像特征进行融合,得到第一图像特征。In one embodiment, the first processing module 902 is further configured to extract sub-image features of each original image from at least two original images; and fuse the at least two sub-image features to obtain the first image features.

在一个实施例中,上述第一处理模块902还用于获取至少两个原始图像中除参考帧之外的每个非参考帧的运动区域掩码;基于参考帧、非参考帧和对应的运动区域掩码,提取每个原始图像的子图像特征。In one embodiment, the first processing module 902 is further used to obtain a motion region mask of each non-reference frame except a reference frame in at least two original images; and extract sub-image features of each original image based on the reference frame, the non-reference frame and the corresponding motion region mask.

在一个实施例中,上述第一处理模块902还用于基于参考帧的拍摄参数,确定参考帧对应的散粒噪声和读出噪声;基于参考帧对应的散粒噪声和读出噪声,生成参考帧的目标噪声图;目标噪声图包含参考帧的噪声信息。In one embodiment, the first processing module 902 is further used to determine the shot noise and readout noise corresponding to the reference frame based on the shooting parameters of the reference frame; based on the shot noise and readout noise corresponding to the reference frame, generate a target noise map of the reference frame; the target noise map contains the noise information of the reference frame.

在一个实施例中,上述第一处理模块902还用于将参考帧中各像素分别乘以散粒噪声,得到中间噪声图;将中间噪声图加上读出噪声,生成参考帧的目标噪声图。In one embodiment, the first processing module 902 is further configured to multiply each pixel in the reference frame by the shot noise to obtain an intermediate noise map; and add the readout noise to the intermediate noise map to generate a target noise map of the reference frame.

在一个实施例中,上述装置还包括运动检测模块;运动检测模块用于对至少两个原始图像中除参考帧之外的非参考帧进行运动检测,确定每个非参考帧的运动区域;基于参考帧的图像信息,更新每个非参考帧的运动区域,得到更新后非参考帧,并以参考帧和更新后非参考帧作为新的至少两个原始图像,上述第一处理模块902用于对从至少两个原始图像中提取的第一图像特征进行去噪处理和解马赛克处理。In one embodiment, the above-mentioned device also includes a motion detection module; the motion detection module is used to perform motion detection on non-reference frames other than the reference frame in at least two original images, and determine the motion area of each non-reference frame; based on the image information of the reference frame, the motion area of each non-reference frame is updated to obtain an updated non-reference frame, and the reference frame and the updated non-reference frame are used as the new at least two original images. The above-mentioned first processing module 902 is used to perform denoising and demosaicing on the first image features extracted from the at least two original images.

在一个实施例中,上述运动检测模块还用于针对每个非参考帧,将非参考帧的运动区域,替换为参考帧中对应于非参考帧的运动区域位置的图像信息,得到更新后非参考帧。In one embodiment, the motion detection module is further used to replace the motion region of each non-reference frame with image information of the reference frame corresponding to the position of the motion region of the non-reference frame to obtain an updated non-reference frame.

在一个实施例中,上述装置还包括配准模块;配准模块用于将至少两个原始图像中除参考帧之外的非参考帧,向参考帧进行配准,得到配准后非参考帧;上述运动检测模块还用于基于参考帧的图像信息,更新每个配准后非参考帧的运动区域,得到更新后非参考帧。In one embodiment, the above-mentioned device also includes a registration module; the registration module is used to align the non-reference frames other than the reference frame in at least two original images with the reference frame to obtain the registered non-reference frames; the above-mentioned motion detection module is also used to update the motion area of each registered non-reference frame based on the image information of the reference frame to obtain the updated non-reference frame.

在一个实施例中,上述配准模块还用于基于参考帧和至少两个原始图像中除参考帧之外的非参考帧,确定参考帧和每个非参考帧之间的运动变换关系;基于每个非参考帧对应的运动变换关系向参考帧进行配准,得到配准后非参考帧。In one embodiment, the above-mentioned registration module is also used to determine the motion transformation relationship between the reference frame and each non-reference frame in the reference frame and at least two original images other than the reference frame; based on the motion transformation relationship corresponding to each non-reference frame, register it with the reference frame to obtain the registered non-reference frame.

在一个实施例中,上运动变换关系包括仿射变换矩阵和特征点光流中的至少一种。In one embodiment, the upper motion transformation relationship includes at least one of an affine transformation matrix and a feature point optical flow.

在一个实施例中,上述装置还包括参考帧确定模块;参考帧确定模块用于确定至少两个原始图像中每个原始图像的清晰度;基于每个原始图像的清晰度,从至少两个原始图像中确定参考帧。In one embodiment, the above-mentioned device also includes a reference frame determination module; the reference frame determination module is used to determine the clarity of each original image in at least two original images; based on the clarity of each original image, determine the reference frame from the at least two original images.

在一个实施例中,上述参考帧确定模块还用于针对每个RAW域的原始图像,将RAW域的原始图像中绿色通道进行平均处理,生成灰度图;从灰度图中提取高斯差算子;基于高斯差算子,确定原始图像的清晰度。In one embodiment, the reference frame determination module is also used to average the green channel of each original image in the RAW domain to generate a grayscale image; extract a Gaussian difference operator from the grayscale image; and determine the clarity of the original image based on the Gaussian difference operator.

在一个实施例中,上述参考帧确定模块还用于将高斯差算子中包括的各个元素进行平均,得到原始图像的清晰度。In one embodiment, the reference frame determination module is further used to average the elements included in the Gaussian difference operator to obtain the clarity of the original image.

在一个实施例中,上述第一处理模块902还用于将第二图像特征映射至RGB域,上述第二处理模块904还用于将第三图像特征映射至RGB域;上述图像生成模块906还用于将RGB域的第二图像特征和RGB域的第三图像特征相加,生成目标图像。In one embodiment, the first processing module 902 is further used to map the second image feature to the RGB domain, and the second processing module 904 is further used to map the third image feature to the RGB domain; the image generation module 906 is further used to add the second image feature in the RGB domain and the third image feature in the RGB domain to generate a target image.

在一个实施例中,上述装置还用于拍摄模块;拍摄模块用于在锁定拍摄参数的情况下,拍摄得到至少两个原始图像。In one embodiment, the above device is also used in a shooting module; the shooting module is used to capture at least two original images under the condition of locking shooting parameters.

上述图像处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above image processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute operations corresponding to each module.

在一个实施例中,提供了一种电子设备,该电子设备可以是终端,其内部结构图可以如图10所示。该电子设备包括处理器、存储器、输入/输出接口、通信接口、显示单元和输入装置。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口、显示单元和输入装置通过输入/输出接口连接到系统总线。其中,该电子设备的处理器用于提供计算和控制能力。该电子设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该电子设备的输入/输出接口用于处理器与外部设备之间交换信息。该电子设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、移动蜂窝网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种图像处理方法。该电子设备的显示单元用于形成视觉可见的画面,可以是显示屏、投影装置或虚拟现实成像装置。显示屏可以是液晶显示屏或者电子墨水显示屏,该电子设备的输入装置可以是显示屏上覆盖的触摸层,也可以是电子设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG10. The electronic device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input/output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input/output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input/output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an image processing method is implemented. The display unit of the electronic device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device housing, or an external keyboard, touchpad or mouse.

本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 10 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行图像处理方法的步骤。The embodiment of the present application further provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, enable the processors to perform the steps of the image processing method.

本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行图像处理方法。The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the image processing method.

需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims (25)

1. An image processing method, comprising:
Denoising and demosaicing the first image features extracted from at least two original images based on noise information of reference frames in the at least two original images to obtain second image features; the frequency of the second image feature is lower than a preset frequency threshold;
performing super-resolution processing on the second image features to obtain third image features; the frequency of the third image feature is higher than or equal to a preset frequency threshold;
and generating a target image according to the second image characteristic and the third image characteristic.
2. The method according to claim 1, wherein the performing a de-noising process and a demosaicing process on the first image feature extracted from the at least two original images based on noise information of reference frames in the at least two original images to obtain the second image feature includes:
denoising the first image features extracted from at least two original images based on noise information of reference frames in the at least two original images to obtain denoised image features;
And performing demosaicing processing on the denoised image characteristics to obtain second image characteristics.
3. The method according to claim 2, wherein denoising the first image feature extracted from the at least two original images based on noise information of reference frames in the at least two original images, to obtain a denoised image feature, comprises:
Performing feature mapping on noise information of reference frames in at least two original images and first image features extracted from the at least two original images to obtain mapping features;
and denoising the mapping characteristics to obtain denoised image characteristics.
4. A method according to claim 3, wherein denoising the mapped feature results in a denoised image feature, comprising:
Sequentially performing downsampling and upsampling on the mapping features to obtain upsampling features; the resolution of the upsampled features is the same as the resolution of the mapped features;
And obtaining the denoising image characteristic based on the upsampling characteristic and the mapping characteristic.
5. The method of claim 2, wherein said demosaicing the de-noised image features to obtain second image features comprises:
And carrying out up-sampling and residual error processing on the denoising image features to obtain second image features.
6. The method of claim 1, wherein performing super-resolution processing on the second image feature to obtain a third image feature comprises:
Residual processing is carried out on the second image feature to obtain a residual processing feature;
and upsampling the residual processing feature to obtain a third image feature.
7. The method of claim 6, wherein upsampling the residual processing feature to obtain a third image feature comprises:
Up-sampling the residual processing features at a preset multiplying power to obtain third image features;
The method further comprises the steps of:
upsampling the second image feature by the preset multiplying power to obtain an upsampled second image feature;
the generating a target image according to the second image feature and the third image feature comprises:
and generating a target image according to the second image characteristic after upsampling and the third image characteristic.
8. The method of claim 1, wherein extracting a first image feature from the at least two original images comprises:
extracting sub-image features of each original image from the at least two original images;
And fusing at least two sub-image features to obtain a first image feature.
9. The method of claim 8, wherein extracting sub-image features of each original image from the at least two original images comprises:
Acquiring a motion area mask of each non-reference frame except the reference frame in the at least two original images;
sub-image features of each original image are extracted based on the reference frame, the non-reference frame, and a corresponding motion region mask.
10. The method according to claim 1, wherein the determining the noise information of the reference frame includes:
determining shot noise and readout noise corresponding to the reference frame based on shooting parameters of the reference frame;
Generating a target noise map of the reference frame based on shot noise and readout noise corresponding to the reference frame; the target noise map includes noise information for the reference frame.
11. The method of claim 10, wherein generating the target noise map for the reference frame based on shot noise and readout noise corresponding to the reference frame comprises:
multiplying each pixel in the reference frame by the shot noise respectively to obtain an intermediate noise diagram;
And adding the intermediate noise map to the readout noise to generate a target noise map of the reference frame.
12. The method according to claim 1, wherein the method further comprises:
Performing motion detection on non-reference frames except for reference frames in the at least two original images, and determining a motion area of each non-reference frame;
and updating a motion area of each non-reference frame based on the image information of the reference frame to obtain an updated non-reference frame, taking the reference frame and the updated non-reference frame as at least two new original images, and executing the steps of denoising and demosaicing the first image features extracted from the at least two original images.
13. The method of claim 12, wherein updating the motion region of each non-reference frame based on the image information of the reference frame to obtain updated non-reference frames comprises:
And for each non-reference frame, replacing the motion area of the non-reference frame with the image information of the motion area position corresponding to the non-reference frame in the reference frame to obtain an updated non-reference frame.
14. The method according to claim 12, wherein the method further comprises:
registering non-reference frames except for the reference frames in the at least two original images to the reference frames to obtain registered non-reference frames;
Updating the motion area of each non-reference frame based on the image information of the reference frame to obtain updated non-reference frames, including:
And updating the motion area of each registered non-reference frame based on the image information of the reference frame to obtain updated non-reference frames.
15. The method of claim 14, wherein registering non-reference frames other than the reference frame in the at least two original images to the reference frame results in a registered non-reference frame, comprising:
Determining a motion transformation relationship between the reference frame and each non-reference frame based on the reference frame and non-reference frames other than the reference frame in the at least two original images;
Registering the reference frames based on the motion transformation relation corresponding to each non-reference frame to obtain registered non-reference frames.
16. The method of claim 15, wherein the motion transformation relationship comprises at least one of an affine transformation matrix and a feature point optical flow.
17. The method according to any one of claims 1 to 16, wherein determining a reference frame from at least two original images comprises:
Determining the definition of each of at least two original images;
a reference frame is determined from at least two original images based on the sharpness of each original image.
18. The method of claim 17, wherein determining sharpness of each of the at least two original images comprises:
For each RAW domain original image, carrying out average processing on a green channel in the RAW domain original image to generate a gray level image;
extracting a Gaussian difference operator from the gray level map;
and determining the definition of the original image based on the Gaussian difference operator.
19. The method of claim 18, wherein the determining the sharpness of the original image based on the gaussian difference operator comprises:
and averaging all elements included in the Gaussian difference operator to obtain the definition of the original image.
20. The method according to any one of claims 1 to 16, further comprising:
mapping the second image feature to an RGB domain and mapping the third image feature to an RGB domain;
the generating a target image according to the second image feature and the third image feature comprises:
And adding the second image features of the RGB domain and the third image features of the RGB domain to generate a target image.
21. The method according to any one of claims 1 to 16, further comprising:
In the case of locking the shooting parameters, at least two original images are shot.
22. An image processing apparatus, comprising:
The first processing module is used for carrying out denoising processing and demosaicing processing on first image features extracted from at least two original images based on noise information of reference frames in the at least two original images to obtain second image features; the frequency of the second image feature is lower than a preset frequency threshold;
The second processing module is used for performing super-resolution processing on the second image features to obtain third image features; the frequency of the third image feature is higher than or equal to a preset frequency threshold;
And the image generation module is used for generating a target image according to the second image characteristic and the third image characteristic.
23. An electronic device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the image processing method according to any of claims 1 to 21.
24. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 21.
25. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 21.
CN202211499327.9A 2022-11-28 2022-11-28 Image processing method, apparatus, electronic device, and computer-readable storage medium Pending CN118115375A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211499327.9A CN118115375A (en) 2022-11-28 2022-11-28 Image processing method, apparatus, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211499327.9A CN118115375A (en) 2022-11-28 2022-11-28 Image processing method, apparatus, electronic device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN118115375A true CN118115375A (en) 2024-05-31

Family

ID=91209108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211499327.9A Pending CN118115375A (en) 2022-11-28 2022-11-28 Image processing method, apparatus, electronic device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN118115375A (en)

Similar Documents

Publication Publication Date Title
CN110827200B (en) Image super-resolution reconstruction method, image super-resolution reconstruction device and mobile terminal
He et al. FHDe2Net: Full high definition demoireing network
US8130278B2 (en) Method for forming an improved image using images with different resolutions
CN111402139A (en) Image processing method, apparatus, electronic device, and computer-readable storage medium
CN106920221A (en) Take into account the exposure fusion method that Luminance Distribution and details are presented
US11334961B2 (en) Multi-scale warping circuit for image fusion architecture
CN113689335B (en) Image processing method and device, electronic device and computer readable storage medium
Xu et al. Image demoireing in raw and srgb domains
CN115049572A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
Vien et al. Single-shot high dynamic range imaging via multiscale convolutional neural network
CN115147304A (en) Image fusion method, device, electronic device and storage medium, product
Lukac Single-sensor imaging in consumer digital cameras: a survey of recent advances and future directions
US20220253651A1 (en) Image fusion processor circuit for dual-mode image fusion architecture
CN112241936B (en) Image processing method, device and equipment and storage medium
CN111383171B (en) Picture processing method, system and terminal equipment
EP4535279A1 (en) Image noise reduction processing method and apparatus, device, storage medium, and program product
CN115063333B (en) Image processing method, device, electronic device and computer readable storage medium
CN117768774A (en) Image processor, image processing method, photographing device and electronic device
CN118115375A (en) Image processing method, apparatus, electronic device, and computer-readable storage medium
CN114902237B (en) Image processing method, device and electronic device
CN114529775A (en) Model training method and device, computer equipment and storage medium
Zhao et al. Modeling dual-exposure quad-bayer patterns for joint denoising and deblurring
CN113379608A (en) Image processing method, storage medium and terminal equipment
CN117522742B (en) Image processing method, architecture, device and computer equipment
CN118155009A (en) Training data generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination