CN112689099B - A ghost-free high dynamic range imaging method and device for a dual-lens camera - Google Patents
A ghost-free high dynamic range imaging method and device for a dual-lens camera Download PDFInfo
- Publication number
- CN112689099B CN112689099B CN202011460648.9A CN202011460648A CN112689099B CN 112689099 B CN112689099 B CN 112689099B CN 202011460648 A CN202011460648 A CN 202011460648A CN 112689099 B CN112689099 B CN 112689099B
- Authority
- CN
- China
- Prior art keywords
- image
- exposure
- short
- exposure image
- long
- 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.)
- Expired - Fee Related
Links
- 238000003384 imaging method Methods 0.000 title claims abstract description 38
- 230000009467 reduction Effects 0.000 claims abstract description 66
- 238000012545 processing Methods 0.000 claims abstract description 31
- 230000001537 neural effect Effects 0.000 claims description 39
- 238000000034 method Methods 0.000 claims description 25
- 238000012549 training Methods 0.000 claims description 17
- 230000004927 fusion Effects 0.000 claims description 16
- 238000001914 filtration Methods 0.000 claims description 5
- 238000013507 mapping Methods 0.000 claims description 3
- 230000009977 dual effect Effects 0.000 claims 1
- 230000006870 function Effects 0.000 description 13
- 238000013527 convolutional neural network Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 9
- 238000004590 computer program Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000012360 testing method Methods 0.000 description 3
- 230000004913 activation Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
本发明实施例提供了一种面向双镜头相机的无重影高动态范围成像方法及装置,获取双镜头相机在同一时刻采集的一张长曝光图像和一张短曝光图像;将所述长曝光图像和所述短曝光图像输入无重影高动态范围成像的主图像增强模型,以使得所述主图像增强模型执行如下操作,获得高动态范围图像:基于所述短曝光图像,对所述长曝光图像进行对齐调整,获得对齐图像;基于所述对齐图像,对所述短曝光图像进行曝光调整以及降噪处理,获得降噪图像;对所述短曝光图像和所述降噪图像进行融合,得到所述高动态范围图像。通过本方案,可以获得面向双镜头相机的无重影的高动态范围图像,提高双镜头相机的成像质量。
Embodiments of the present invention provide a ghost-free high dynamic range imaging method and device for a dual-lens camera, to obtain a long-exposure image and a short-exposure image collected by the dual-lens camera at the same time; The image and the short exposure image are input into a main image enhancement model for ghost-free high dynamic range imaging, so that the main image enhancement model performs the following operations to obtain a high dynamic range image: performing alignment adjustment on the exposure image to obtain an aligned image; performing exposure adjustment and noise reduction processing on the short-exposure image based on the aligned image to obtain a noise-reduced image; and fusing the short-exposure image and the noise-reduced image, The high dynamic range image is obtained. With this solution, a ghost-free high dynamic range image for the dual-lens camera can be obtained, and the imaging quality of the dual-lens camera can be improved.
Description
技术领域technical field
本发明涉及数字图像处理技术领域,特别是涉及一种面向双镜头相机的无重影高动态范围成像方法及装置。The invention relates to the technical field of digital image processing, in particular to a ghost-free high dynamic range imaging method and device for a dual-lens camera.
背景技术Background technique
随着技术的发展,双镜头相机被越来越多地应用于移动终端。由于移动终端通常为普通消费级别的电子设备,因此,用于移动终端的双镜头相机受到硬件限制,通常只能拍摄得到曝光范围很小的低动态范围图像,远远达不到高动态范围图像的质量。对此,为了提高双镜头相机的成像质量,可以利用同一时间拍摄的两张曝光不同的低动态范围图像,合成高动态范围图像。With the development of technology, dual-lens cameras are increasingly used in mobile terminals. Since mobile terminals are usually ordinary consumer-level electronic devices, the dual-lens cameras used in mobile terminals are limited by hardware, and usually can only capture low dynamic range images with a small exposure range, far from high dynamic range images. the quality of. In this regard, in order to improve the image quality of the dual-lens camera, two low dynamic range images with different exposures captured at the same time can be used to synthesize high dynamic range images.
相关技术中,可以对两张低动态范围图像进行对齐调整,得到对齐后的图像,将对齐后的图像和两张低动态范围图像中曝光时间更短的短曝光图像的像素值融合在一张图像中,得到高动态范围图像。其中,对齐调整可以包括:寻找两张图像中像素的一一对应关系,并按照该对应关系,利用短曝光图像,重构两张低动态范围图像中曝光时间更长的长曝光图像,得到对齐后的图像。In the related art, two low dynamic range images can be aligned and adjusted to obtain an aligned image, and the pixel values of the aligned image and the short exposure image with shorter exposure time in the two low dynamic range images are fused into one image. image, a high dynamic range image is obtained. The alignment adjustment may include: finding a one-to-one correspondence between pixels in the two images, and according to the correspondence, using the short-exposure image to reconstruct a long-exposure image with a longer exposure time in the two low-dynamic-range images to obtain an alignment post image.
但是,由于上述两张低动态范围图像的曝光时间不同,因此,对齐后的图像中往往存在没有准确对应的像素,对齐后的图像存在错误对齐的区域,导致高动态范围图像产生重影。However, due to the different exposure times of the above two low dynamic range images, there are often pixels that do not correspond accurately in the aligned images, and there are incorrectly aligned areas in the aligned images, resulting in ghosting in the high dynamic range images.
发明内容SUMMARY OF THE INVENTION
本发明实施例的目的在于提供一种面向双镜头相机的无重影高动态范围成像方法及装置,用以解决双镜头相机的高动态范围图像存在重影的问题。具体技术方案如下:The purpose of the embodiments of the present invention is to provide a ghost-free high dynamic range imaging method and device for a dual-lens camera, so as to solve the problem of ghosting in the high dynamic range image of the dual-lens camera. The specific technical solutions are as follows:
第一方面,本发明实施例提供了一种面向双镜头相机的无重影高动态范围成像方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a ghost-free high dynamic range imaging method for a dual-lens camera, the method comprising:
获取双镜头相机在同一时刻采集的一张长曝光图像和一张短曝光图像;Obtain a long-exposure image and a short-exposure image captured by the dual-lens camera at the same moment;
将所述长曝光图像和所述短曝光图像输入无重影高动态范围成像的主图像增强模型,以使得所述主图像增强模型执行如下操作,获得高动态范围图像:The long-exposure image and the short-exposure image are input into a main image enhancement model for ghost-free high dynamic range imaging, so that the main image enhancement model performs the following operations to obtain a high dynamic range image:
基于所述短曝光图像,对所述长曝光图像进行对齐调整,获得对齐图像;Based on the short exposure image, performing alignment adjustment on the long exposure image to obtain an alignment image;
基于所述对齐图像,对所述短曝光图像进行曝光调整以及降噪处理,获得降噪图像;Based on the alignment image, performing exposure adjustment and noise reduction processing on the short exposure image to obtain a noise reduction image;
对所述短曝光图像和所述降噪图像进行融合,得到所述高动态范围图像。The short exposure image and the noise reduction image are fused to obtain the high dynamic range image.
第二方面,本发明实施例提供了一种面向双镜头相机的无重影高动态范围成像装置,所述装置包括:In a second aspect, an embodiment of the present invention provides a ghost-free high dynamic range imaging device for a dual-lens camera, the device comprising:
输入获取模块,用于获取双镜头相机在同一时刻采集的一张长曝光图像和一张短曝光图像;The input acquisition module is used to acquire a long-exposure image and a short-exposure image collected by the dual-lens camera at the same time;
图像处理模块,用于将所述长曝光图像和所述短曝光图像输入无重影高动态范围成像的主图像增强模型,以使得所述主图像增强模型执行如下操作,获得高动态范围图像:An image processing module, configured to input the long-exposure image and the short-exposure image into a main image enhancement model for ghost-free high dynamic range imaging, so that the main image enhancement model performs the following operations to obtain a high dynamic range image:
基于所述短曝光图像,对所述长曝光图像进行对齐调整,获得对齐图像;Based on the short exposure image, performing alignment adjustment on the long exposure image to obtain an alignment image;
基于所述对齐图像,对所述短曝光图像进行曝光调整以及降噪处理,获得降噪图像;Based on the alignment image, performing exposure adjustment and noise reduction processing on the short exposure image to obtain a noise reduction image;
对所述短曝光图像和所述降噪图像进行融合,得到所述高动态范围图像。The short exposure image and the noise reduction image are fused to obtain the high dynamic range image.
本发明实施例有益效果:Beneficial effects of the embodiment of the present invention:
本发明实施例提供的方案中,将双镜头相机在同一时刻采集的一张长曝光图像和一张短曝光图像,输入无重影高动态范围成像的主图像增强模型,进而该主图像增强模型可以基于短曝光图像,对长曝光图像进行对齐调整,获得对齐图像;基于对齐图像,对短曝光图像进行曝光调整以及降噪处理,获得降噪图像;对短曝光图像和降噪图像进行融合,得到高动态范围图像。其中,基于对齐图像对短曝光图像进行曝光调整以及降噪处理,得到降噪图像,可以保证对齐图像对曝光调整和降噪处理产生贡献。因此,可以在将对齐图像包含的信息通过曝光调整和降噪处理加入降噪图像的同时,保证降噪图像中像素的位置不会受到对齐图像的影响,避免重影的产生,进而对短曝光图像和降噪图像进行融合,得到的高动态范围图像不存在重影。可见,通过本方案,可以获得面向双镜头相机的无重影的高动态范围图像,提高双镜头相机的成像质量。In the solution provided by the embodiment of the present invention, a long-exposure image and a short-exposure image collected by a dual-lens camera at the same time are input into the main image enhancement model of ghost-free high dynamic range imaging, and then the main image enhancement model Based on the short-exposure image, the long-exposure image can be aligned and adjusted to obtain an aligned image; based on the aligned image, the short-exposure image can be subjected to exposure adjustment and noise reduction processing to obtain a noise-reduced image; the short-exposure image and the noise-reduced image can be fused, Get high dynamic range images. Among them, exposure adjustment and noise reduction processing are performed on the short-exposure image based on the aligned image to obtain a noise reduction image, which can ensure that the aligned image contributes to exposure adjustment and noise reduction processing. Therefore, the information contained in the alignment image can be added to the denoised image through exposure adjustment and noise reduction, while ensuring that the position of the pixels in the denoised image will not be affected by the alignment image, avoiding the generation of ghosting, and further reducing short exposures. The image and the denoised image are fused, and the resulting high dynamic range image has no ghosting. It can be seen that through this solution, a ghost-free high dynamic range image for the dual-lens camera can be obtained, and the imaging quality of the dual-lens camera can be improved.
当然,实施本发明的任一产品或方法并不一定需要同时达到以上所述的所有优点。Of course, it is not necessary for any product or method of the present invention to achieve all of the advantages described above at the same time.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can also be obtained according to these drawings without creative efforts.
图1为本发明一实施例提供的一种面向双镜头相机的无重影高动态范围成像方法的流程示意图;1 is a schematic flowchart of a ghost-free high dynamic range imaging method for a dual-lens camera according to an embodiment of the present invention;
图2为本发明另一实施例提供的一种面向双镜头相机的无重影高动态范围成像方法中,对齐图像的获取流程示例图;FIG. 2 is an exemplary diagram of an acquisition flow of an aligned image in a ghost-free high dynamic range imaging method for a dual-lens camera provided by another embodiment of the present invention;
图3为本发明另一实施例提供的一种面向双镜头相机的无重影高动态范围成像方法中,降噪图像的获取流程示例图;FIG. 3 is an example diagram of an acquisition process of a noise-reduced image in a ghost-free high dynamic range imaging method for a dual-lens camera provided by another embodiment of the present invention;
图4为本发明另一实施例提供的一种面向双镜头相机的无重影高动态范围成像方法的示例图;4 is an exemplary diagram of a ghost-free high dynamic range imaging method for a dual-lens camera provided by another embodiment of the present invention;
图5为本发明一实施例提供的一种面向双镜头相机的无重影高动态范围成像装置的结构示意图;5 is a schematic structural diagram of a ghost-free high dynamic range imaging device for a dual-lens camera according to an embodiment of the present invention;
图6为本发明一实施例提供的电子设备的结构示意图FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明实施例提供的一种面向双镜头相机的无重影高动态范围成像方法,可以应用于双镜头相机或者采用双镜头采集图像的电子设备,例如双镜头的移动终端,可穿戴设备等等。A ghost-free high dynamic range imaging method for a dual-lens camera provided by an embodiment of the present invention can be applied to a dual-lens camera or an electronic device that uses a dual-lens to capture images, such as a dual-lens mobile terminal, a wearable device, etc. .
如图1所示,本发明一实施例提供的一种面向双镜头相机的无重影高动态范围成像方法的流程,其该方法可以包括如下步骤:As shown in FIG. 1, an embodiment of the present invention provides a process of a dual-lens camera-oriented high dynamic range imaging method without ghosting, and the method may include the following steps:
S101,获取双镜头相机在同一时刻采集的一张长曝光图像和一张短曝光图像。S101 , acquiring a long-exposure image and a short-exposure image acquired by the dual-lens camera at the same moment.
在具体应用中,双镜头相机的两个镜头可以是相同型号的镜头。并且,上述一张长曝光图像和一张短曝光图像为同一拍摄对象的图像。其中,长曝光图像的曝光时间大于短曝光图像的曝光时间。In a specific application, the two lenses of the dual-lens camera may be lenses of the same model. Moreover, the above-mentioned one long-exposure image and one short-exposure image are images of the same subject. The exposure time of the long-exposure image is greater than the exposure time of the short-exposure image.
S102,将长曝光图像和短曝光图像输入无重影高动态范围成像的主图像增强模型,以使得主图像增强模型执行步骤S1021至S1023的操作,获得高动态范围图像。S102 , input the long exposure image and the short exposure image into the main image enhancement model for ghost-free high dynamic range imaging, so that the main image enhancement model performs the operations of steps S1021 to S1023 to obtain a high dynamic range image.
S1021,基于短曝光图像,对长曝光图像进行对齐调整,获得对齐图像。S1021 , based on the short-exposure image, perform alignment adjustment on the long-exposure image to obtain an aligned image.
在具体应用中,基于短曝光图像,对长曝光图像进行对齐调整,获得对齐图像的具体方式,可以是多种的。示例性的,可以对短曝光图像和长曝光图像中的像素点,进行一一对齐,利用短曝光图像中像素点的信息调整长曝光图像中像素点的信息,获得对齐图像。或者,示例性的,可以利用长曝光图像对短曝光图像进行曝光调整,得到第一软曝光图像;将长曝光图像和第一软曝光图像,输入预先训练得到的图像匹配卷积神经子网络,以使得图像匹配卷积神经子网络将长曝光图像调整为与第一软曝光图像对齐的图像,得到对齐图像。为了便于理解和合理布局,后续以可选实施例的形式对第二种示例性情况进行具体说明。In a specific application, based on the short exposure image, the alignment adjustment is performed on the long exposure image, and there may be various specific ways to obtain the aligned image. Exemplarily, the pixels in the short-exposure image and the long-exposure image can be aligned one-to-one, and the information of the pixels in the short-exposure image is adjusted by adjusting the information of the pixels in the long-exposure image to obtain an aligned image. Or, exemplarily, the long-exposure image may be used to adjust the exposure of the short-exposure image to obtain a first soft-exposure image; the long-exposure image and the first soft-exposure image may be input into a pre-trained image matching convolutional neural sub-network, An aligned image is obtained by adjusting the long-exposure image to an image aligned with the first soft-exposure image so that the image-matching convolutional neural sub-network. In order to facilitate understanding and reasonable layout, the second exemplary case will be specifically described in the form of optional embodiments in the following.
S1022,基于对齐图像,对短曝光图像进行曝光调整以及降噪处理,获得降噪图像。S1022, based on the alignment image, perform exposure adjustment and noise reduction processing on the short exposure image to obtain a noise reduction image.
基于对齐图像,对短曝光图像进行曝光调整以及降噪处理时,具体可以参考对齐图像的像素,获取用于对短曝光图像本身的像素进行调整以及降噪的信息,从而按照所获取的信息对短曝光图像进行曝光调整以及降噪处理。为了便于理解和合理布局,后续以可选实施例的形式对基于对齐图像,对短曝光图像进行曝光调整以及降噪处理,获得降噪图像的具体方式进行说明。When performing exposure adjustment and noise reduction processing on a short-exposure image based on the aligned image, you can specifically refer to the pixels of the aligned image to obtain information for adjusting and denoising the pixels of the short-exposure image itself, so as to perform Short exposure images undergo exposure adjustment and noise reduction. In order to facilitate understanding and reasonable layout, a specific manner of obtaining a noise-reduced image by performing exposure adjustment and noise reduction processing on a short-exposure image based on an aligned image will be described in the form of an optional embodiment.
S1023,对短曝光图像和降噪图像进行融合,得到高动态范围图像。S1023, fuse the short exposure image and the noise reduction image to obtain a high dynamic range image.
降噪图像是基于对齐图像得到的,因此,包含有长曝光图像的信息。以此为基础,对短曝光图像和降噪图像进行融合,可以保证融合得到的图像包含短曝光和长曝光图像中的信息,是曝光范围高于短曝光图像和长曝光图像的高动态范围图像。为了便于理解和合理布局,后续以可选实施例的形式具体说明对短曝光图像和降噪图像进行融合,得到高动态范围图像的过程。The denoised image is based on the aligned image and, therefore, contains information from the long exposure image. Based on this, the short exposure image and the noise reduction image are fused to ensure that the fused image contains the information in the short exposure and long exposure images, and is a high dynamic range image with a higher exposure range than the short exposure image and the long exposure image. . In order to facilitate understanding and reasonable layout, the process of fusing a short exposure image and a noise reduction image to obtain a high dynamic range image will be specifically described in the form of an optional embodiment in the following.
本发明实施例提供的方案中,基于对齐图像对短曝光图像进行曝光调整以及降噪处理,得到降噪图像,可以保证对齐图像对曝光调整和降噪处理产生贡献。因此,可以在将对齐图像包含的信息通过曝光调整和降噪处理加入降噪图像的同时,保证降噪图像中像素的位置不会受到对齐图像的影响,避免重影的产生,进而对短曝光图像和降噪图像进行融合,得到的高动态范围图像不存在重影。可见,通过本方案,可以获得面向双镜头相机的无重影的高动态范围图像,提高双镜头相机的成像质量。In the solution provided by the embodiment of the present invention, exposure adjustment and noise reduction processing are performed on the short-exposure image based on the aligned image to obtain a noise reduction image, which can ensure that the aligned image contributes to exposure adjustment and noise reduction processing. Therefore, the information contained in the alignment image can be added to the denoised image through exposure adjustment and noise reduction, while ensuring that the position of the pixels in the denoised image will not be affected by the alignment image, avoiding the generation of ghosting, and further reducing short exposures. The image and the denoised image are fused, and the resulting high dynamic range image has no ghosting. It can be seen that through this solution, a ghost-free high dynamic range image for the dual-lens camera can be obtained, and the imaging quality of the dual-lens camera can be improved.
在一种可选的实施方式中,上述基于短曝光图像,对长曝光图像进行对齐调整,获得对齐图像,具体可以包括如下步骤A1至A2:In an optional implementation manner, the above-mentioned alignment adjustment is performed on the long exposure image based on the short exposure image to obtain the aligned image, which may specifically include the following steps A1 to A2:
A1,利用长曝光图像对短曝光图像进行曝光调整,得到第一软曝光图像;A1, using the long-exposure image to adjust the exposure of the short-exposure image to obtain a first soft-exposure image;
A2,将长曝光图像和第一软曝光图像,输入预先训练得到的图像匹配卷积神经子网络,以使得图像匹配卷积神经子网络将长曝光图像调整为与第一软曝光图像对齐的图像,得到对齐图像;A2, input the long-exposure image and the first soft-exposure image into the image-matching convolutional neural sub-network obtained by pre-training, so that the image-matching convolutional neural sub-network adjusts the long-exposure image to an image aligned with the first soft-exposure image , get the aligned image;
其中,图像匹配卷积神经子网络为利用多个样本长曝光图像,多个样本短曝光图像以及每个样本短曝光图像分别对应的真实长曝光图像训练得到的网络;任一短曝光图像对应的真实长曝光图像为双镜头相机对该短曝光图像进行物理长曝光得到的图像。The image matching convolutional neural sub-network is a network trained by using multiple sample long-exposure images, multiple sample short-exposure images, and real long-exposure images corresponding to each sample short-exposure image; The real long-exposure image is an image obtained by performing physical long-exposure on the short-exposure image by the dual-lens camera.
本可选实施例通过利用长曝光图像对短曝光图像进行曝光调整,相当于模拟相机的物理曝光,从而实现对短曝光图像的软曝光。并且,利用第一软曝光图像获取对齐图像,与直接利用短曝光获取对齐图像相比,利用长曝光图像获得的第一软曝光图像与长曝光图像的曝光更加相似,因此,可以降低对齐调整的复杂度,使得对齐调整更容易实现。In this optional embodiment, by using the long-exposure image to adjust the exposure of the short-exposure image, it is equivalent to simulating the physical exposure of a camera, thereby realizing soft exposure of the short-exposure image. Furthermore, by using the first soft-exposure image to obtain the alignment image, the exposure of the first soft-exposure image obtained by using the long-exposure image is more similar to that of the long-exposure image compared to directly using the short-exposure image to obtain the alignment image. Therefore, the alignment adjustment can be reduced. complexity, making alignment adjustments easier to implement.
在一种可选的实施方式中,上述步骤A1:利用长曝光图像对短曝光图像进行曝光调整,得到第一软曝光图像,具体可以包括如下步骤:In an optional implementation manner, the above step A1: using the long-exposure image to adjust the exposure of the short-exposure image to obtain the first soft-exposure image, may specifically include the following steps:
获取长曝光图像的直方图,作为目标直方图;Obtain the histogram of the long exposure image as the target histogram;
对短曝光图像进行曝光调整,并获取调整后的短曝光图像的直方图,作为待调整直方图;Perform exposure adjustment on the short-exposure image, and obtain a histogram of the adjusted short-exposure image as the histogram to be adjusted;
将待调整直方图调整至与目标直方图之间的差异值满足预设差异条件,得到调整后的直方图,并将调整后的直方图对应的图像作为第一软曝光图像。Adjust the histogram to be adjusted so that the difference value between the histogram to be adjusted and the target histogram satisfies the preset difference condition, obtain an adjusted histogram, and use the image corresponding to the adjusted histogram as the first soft exposure image.
本可选实施例利用直方图的调整,也就是直方图的均衡化实现软曝光,可以降低对长曝光图像和短曝光图像之间匹配对齐的要求,进一步降低获取对齐图像的复杂度。This optional embodiment utilizes the adjustment of the histogram, that is, the equalization of the histogram to achieve soft exposure, which can reduce the requirement for matching and alignment between the long-exposure image and the short-exposure image, and further reduce the complexity of obtaining aligned images.
在一种可选的实施方式中,上述步骤A2中的:图像匹配卷积神经子网络将长曝光图像调整为与第一软曝光图像对齐的图像,得到对齐图像,具体可以包括如下步骤:In an optional implementation manner, in the above step A2: the image matching convolutional neural sub-network adjusts the long-exposure image to an image aligned with the first soft-exposure image to obtain an aligned image, which may specifically include the following steps:
提取长曝光图像的深度特征作为第一深度特征,以及提取第一软曝光图像的深度特征作为第二深度特征;extracting the depth feature of the long exposure image as the first depth feature, and extracting the depth feature of the first soft exposure image as the second depth feature;
将第一深度特征和所述第二深度特征映射为一个四维特征,作为第一四维特征;第一四维特征为用于反映第一深度特征和第二深度特征的特征;The first depth feature and the second depth feature are mapped to a four-dimensional feature, as the first four-dimensional feature; the first four-dimensional feature is a feature used to reflect the first depth feature and the second depth feature;
利用三维调节网络将第一四维特征调节为三维特征;Adjusting the first four-dimensional feature into a three-dimensional feature using a three-dimensional adjustment network;
针对三维特征中的每个像素点,将该像素点与长曝光图像中相应位置的像素点进行加权平均,得到对齐图像。For each pixel in the three-dimensional feature, weighted average is performed between the pixel and the pixel at the corresponding position in the long-exposure image to obtain an aligned image.
示例性的,如图2所示。对于输入图像匹配卷积神经子网络的长曝光图像IL和第一软曝光图像ISE’,首先通过残差网络分别提取长曝光图像IL的深度特征FL,以及第一软曝光图像ISE’的深度特征FSE’。其中,FL即为第一深度特征,FSE’即为第二深度特征。并且,残差网络第一层为5×5的卷积,步长为2,接着是8个相同的残差模块,每个残差模块由2个卷积核大小是3×3的卷积层和一个连接层组成,最后一层是1个卷积核大小是3×3的卷积层。得到深度特征FL与FSE’后,在第一软曝光图像ISE’的每个像素点(j,i),以及长曝光图像IL中的对应像素点(j,i+k)之间,建立一个四维特征,得到第一四维特征VA。然后将第一四维特征输入到一个三维正则化网络中。该三维正则化网络依次包括:多个3×3×3的卷积层,4个残差模块,一层3×3×3的转置卷积层,以及一个激活函数为softmax的激活层。其中,每个残差模块由一个3×3×3的转置卷积层加一个残差连接组成。该三维正则化网络的输出结果为三维特征WA。当获得三维特征WA后,对齐图像ILA的每一个像素点(j,i)的值,就能由IL中对应的候选像素点加权平均得到。Illustratively, as shown in FIG. 2 . For the long-exposure image IL and the first soft-exposure image I SE' of the input image matching convolutional neural sub-network, the depth feature FL of the long-exposure image IL and the first soft-exposure image I are firstly extracted through the residual network. The depth feature F SE ' of SE' . Among them, FL is the first depth feature, and F SE' is the second depth feature. Moreover, the first layer of the residual network is a 5×5 convolution with a stride of 2, followed by 8 identical residual modules, each of which consists of 2 convolution kernels with a size of 3×3 convolution layer and a connection layer, the last layer is a convolution layer with a convolution kernel size of 3 × 3. After obtaining the depth features FL and F SE' , between each pixel point (j, i) in the first soft exposure image I SE' and the corresponding pixel point (j, i+k) in the long exposure image IL During this time, a four-dimensional feature is established, and the first four - dimensional feature VA is obtained. The first 4D features are then fed into a 3D regularization network. The 3D regularization network sequentially includes: multiple 3×3×3 convolutional layers, 4 residual modules, a 3×3×3 transposed convolutional layer, and an activation layer with an activation function of softmax. Among them, each residual module consists of a 3×3×3 transposed convolutional layer plus a residual connection. The output of the 3D regularization network is a 3D feature W A . When the three-dimensional feature WA is obtained, the value of each pixel ( j , i) of the aligned image I LA can be obtained by weighted average of the corresponding candidate pixels in I L .
其中,第一四维特征VA,如下式所示:Among them, the first four-dimensional feature V A is shown in the following formula:
Concat代表张量连接,代表第一四维特征VA的元素点(jV,iV,kV)的特征值,代表像素点(j,i)的深度特征,代表像素点(j,i+k)的深度特征。由此,第一四维特征VA的元素点(jV,iV,kV)的特征值是根据深度特征FL中像素点(j,i+k)的深度特征与FSE’像素点(j,i)的深度特征进行张量连接得到的。由于输入图像对的像素间存在一维相对运动,对每个像素点(j,i)的对应的候选像素点的范围被定义为(j,i)到(j,i+d-1),其中超参数d为相对最大距离,例如,可以为图像宽度的20%,也就是说k可以为d-1。Concat stands for tensor concatenation, represents the eigenvalues of the element points ( j V , i V , kV ) of the first four-dimensional feature VA, represents the depth feature of the pixel point (j, i), Represents the depth feature of the pixel point (j, i+k). Therefore, the feature value of the element point ( j V , i V , kV ) of the first four-dimensional feature VA is the depth feature of the pixel point (j, i+k) in the depth feature FL Depth feature with F SE' pixel point (j, i) obtained by concatenating tensors. Since there is a one-dimensional relative motion between the pixels of the input image pair, the range of the corresponding candidate pixels for each pixel (j, i) is defined as (j, i) to (j, i+d-1), The hyperparameter d is the relative maximum distance, for example, it can be 20% of the image width, that is, k can be d-1.
然后,将第一四维特征VA输入三维正则化网络以估算空间为h×w×d的三维特征WA。当获得三维特征WA后,针对三维特征中的每个元素点,将该像素点与长曝光图像中相应位置的像素点进行加权平均,得到对齐图像,即下式:Then, the first four-dimensional feature VA is input into a three-dimensional regularization network to estimate a three-dimensional feature WA of space h×w×d. When the three - dimensional feature WA is obtained, for each element point in the three-dimensional feature, the pixel point and the pixel point in the corresponding position in the long-exposure image are weighted and averaged to obtain an aligned image, that is, the following formula:
其中,为像素点(j,i)在对齐图像上的像素值,为三维特征的元素点(jV,iV,kV)的特征值,为像素点(j,i+k)在长曝光图像上的像素值。in, is the pixel value of the pixel point (j, i) on the aligned image, is the eigenvalue of the element point (j V , i V , k V ) of the three-dimensional feature, is the pixel value of the pixel point (j, i+k) on the long exposure image.
在具体应用中,可以将同一时刻拍摄的一个样本长曝光图像,一个样本短曝光图像以及相应的真实长曝光图像作为一对样本图像,一对样本图像可以由分别对应的真实长曝光图像可以由两台曝光时间不同、型号相同的相机在同一时刻拍摄得到。示例性的,多对样本图像的数量可以是1000对。并且,可以使用结构相似性(Structural SIMilarity,SSIM,一种衡量两幅图像相似度的指标)作为度量函数定义第一损失函数L2,以用于对图像匹配卷积神经子网络的训练。其中,第一损失函数L2定义为如下公式(1):In a specific application, a sample long-exposure image, a sample short-exposure image, and a corresponding real long-exposure image captured at the same time can be used as a pair of sample images, and a pair of sample images can be composed of the corresponding real long-exposure images. Two cameras with different exposure times and the same model were shot at the same time. Exemplarily, the number of pairs of sample images may be 1000 pairs. And, a first loss function L 2 can be defined by using structural similarity (Structural SIMilarity, SSIM, an index to measure the similarity of two images) as a metric function, which is used for training the image matching convolutional neural sub-network. Among them, the first loss function L 2 is defined as the following formula (1):
L2=1-SSIM(ILA,GSE);L 2 =1-SSIM(I LA , G SE );
其中,ILA为对齐图像,GSE为样本短曝光图像对应的真实长曝光图像。以此为基础,图像匹配卷积神经子网络的训练,具体可以包括:利用多个样本长曝光图像,多个样本短曝光图像对预先构建的图像匹配卷积神经子网络进行训练,得到图像匹配卷积神经子网络输出的样本对齐图像;利用样本对齐图像和获取该样本对齐图像所利用的样本短曝光图像对应的真实长曝光图像,以及第一损失函数L2,以最小化第一损失函数为目标,调整进行训练的图像匹配卷积神经子网络的网络参数,当目标达成时,完成对图像匹配卷积神经子网络的训练。Among them, I LA is the alignment image, and G SE is the real long-exposure image corresponding to the sample short-exposure image. Based on this, the training of the image matching convolutional neural network may specifically include: using multiple sample long-exposure images and multiple sample short-exposure images to train the pre-built image matching convolutional neural network to obtain image matching. The sample-aligned image output by the convolutional neural network; the real long-exposure image corresponding to the sample-aligned image and the sample short-exposure image used to obtain the sample-aligned image, and the first loss function L 2 to minimize the first loss function As the goal, adjust the network parameters of the image matching convolutional neural sub-network for training, and when the goal is achieved, complete the training of the image-matching convolutional neural sub-network.
在一种可选的实施方式中,上述基于对齐图像,对短曝光图像进行曝光调整以及降噪处理,获得降噪图像,具体可以包括如下步骤B1至步骤B2:In an optional implementation manner, the above-mentioned method of performing exposure adjustment and noise reduction processing on the short-exposure image based on the aligned image to obtain a noise-reduced image may specifically include the following steps B1 to B2:
步骤B1,利用对齐图像对短曝光图像进行曝光调整,得到第二软曝光图像;Step B1, using the alignment image to perform exposure adjustment on the short-exposure image to obtain a second soft-exposure image;
步骤B2,将对齐图像和第二软曝光图像,输入预先训练得到的三维引导降噪卷积神经子网络,以使得三维引导降噪卷积神经子网络按照对齐图像对第二软曝光图像进行降噪,得到降噪图像;其中,三维引导降噪神经子网络为利用多个样本对齐图像,多个样本短曝光图像以及多个所述真实长曝光图像训练得到的网络。In step B2, the alignment image and the second soft exposure image are input into the pre-trained three-dimensional guided noise reduction convolutional neural sub-network, so that the three-dimensional guided noise reduction convolutional neural sub-network degrades the second soft exposure image according to the aligned image. noise to obtain a denoised image; wherein, the three-dimensional guided denoising neural sub-network is a network trained by using multiple sample alignment images, multiple sample short exposure images and multiple real long exposure images.
在具体应用中,步骤B1可以包括:获取对齐图像的直方图,作为第二目标直方图;对短曝光图像进行曝光调整,并获取调整后的短曝光图像的直方图,作为第二待调整直方图;将第二待调整直方图调整至与第二目标直方图之间的差异值满足预设差异条件,得到调整后的直方图,并将调整后的直方图对应的图像作为第二软曝光图像。本可选实施例中,利用对齐图像获取第二软曝光图像,有利于提高软曝光的准确度。其中,预设差异条件与本发明步骤A1中的预设差异条件相似,区别在于输入的图像不同。In a specific application, step B1 may include: acquiring a histogram of the aligned image as the second target histogram; performing exposure adjustment on the short-exposure image, and acquiring the histogram of the adjusted short-exposure image as the second to-be-adjusted histogram Fig.; Adjust the second to-be-adjusted histogram so that the difference between the second target histogram and the second target histogram satisfies the preset difference condition, obtain the adjusted histogram, and use the image corresponding to the adjusted histogram as the second soft exposure image. In this optional embodiment, the alignment image is used to obtain the second soft exposure image, which is beneficial to improve the accuracy of the soft exposure. Wherein, the preset difference condition is similar to the preset difference condition in step A1 of the present invention, and the difference is that the input images are different.
在一种可选的实施方式中,上述三维引导降噪卷积神经子网络按照对齐图像对第二软曝光图像进行降噪,得到降噪图像,具体可以包括如下步骤:In an optional implementation manner, the above-mentioned three-dimensional guided noise reduction convolutional neural sub-network performs noise reduction on the second soft exposure image according to the aligned image to obtain a noise reduction image, which may specifically include the following steps:
将对齐图像和第二软曝光图像映射为一个四维特征,作为第二四维特征;第二四维特征用于反映所述对齐图像中各像素点和第二软曝光图像中相应的像素点的特征;The alignment image and the second soft exposure image are mapped into a four-dimensional feature as a second four-dimensional feature; the second four-dimensional feature is used to reflect the difference between each pixel in the aligned image and the corresponding pixel in the second soft exposure image feature;
利用预设的三维滤波权重,对第二四维特征进行加权平均处理,得到降噪图像。Using a preset three-dimensional filter weight, weighted average processing is performed on the second four-dimensional feature to obtain a denoised image.
得到的降噪图像的每一个像素点(j,i)都是由第二软曝光图像ISE对应的像素的邻近像素进行加权平均得到的。其中,权重矩阵WD由一个三维U-型网络学习得到。该三维U-型网络的输入为一个由第二软曝光图像ISE与对齐图像ILA通过映射构建的空间为h×w×s2×m的第二四维特征VD。其中,h为第二四维特征VD的高,w为第二四维特征VD的宽,s2为第二四维特征VD的长,m为第二四维特征VD中三维切片的数量。该三维U-型网络的前14层为相同的卷积核大小为3×3×3的卷积层,接着为4个残差模块,每个残差模块由一次3×3×3的转置卷积层加一个残差连接组成,最后为一层3×3×3转置卷积层与一个基于softmax的归一化层。The resulting denoised image Each pixel point (j, i) of is obtained by the weighted average of the adjacent pixels of the pixel corresponding to the second soft exposure image I SE . Among them, the weight matrix WD is learned by a three- dimensional U-shaped network. The input of the three-dimensional U-shaped network is a second four-dimensional feature V D of space h×w×s 2 ×m constructed by mapping the second soft-exposure image I SE and the alignment image I LA . Among them, h is the height of the second four-dimensional feature V D , w is the width of the second four-dimensional feature V D , s 2 is the length of the second four-dimensional feature V D , and m is the three dimensions of the second four-dimensional feature V D The number of slices. The first 14 layers of the 3D U-shaped network are the same convolutional layers with the same convolution kernel size of 3×3×3, followed by 4 residual modules, each of which is composed of a 3×3×3 transformation. It consists of a convolutional layer and a residual connection, and finally a 3×3×3 transposed convolutional layer and a softmax-based normalization layer.
其中,降噪图像的每一个像素点(j,i)都是由第二软曝光图像ISE对应的像素的邻近像素进行加权平均得到的,即如下公式(2):Among them, the denoised image Each pixel point (j, i) of is obtained by the weighted average of the adjacent pixels of the pixel corresponding to the second soft exposure image I SE , that is, the following formula (2):
其中,Ω(j,i)是一个长宽都为s的矩形区域,且区域的中心为像素点(j,i)。r为窗口半径。滤波权重WD是一个空间为h×w×s2的三维的权重,该权重可以由三维联合降噪卷积神经网络训练得到。示例性的,如图3所示。在图像层面的处理流程可以包括:首先使用输入图像:第二软曝光图像ISE与对齐图像ILA去构建一个空间为h×w×s2×m的第二四维特征VD;得到第二四维特征VD后,本发明使用三维U-型网络从中学习滤波权重WD。三维U-型网络类似于传统的U-型网络,区别在于本发明使用三维卷积而不是二维卷积。在得到滤波权重WD后,就能用公式(2)得到降噪图像针对每一个像素点(j,i)的像素层面的处理流程:以该像素点为中心的矩形区域,也就是二维临近像素区Ω(j,i)需要被重塑为一维切片;对于Ω(j,i)中的每一个像素点(j’,i’),在第二四维特征VD与滤波权重WD的特征值与权重值分别为与每个Ω(j,i)区域的像素点(j’,i’)与中心像素点(j,i)对应的四维特征是由ISE与ISA中像素点(j’,i’)的像素值、ISA的中心点(j,i)的像素值以及像素点(j,i)与像素点(j’,i’)两点的几何距离Dgm((j',i')(j,i))=(j-j')2+(i-i')2共同决定的,即下式:Among them, Ω(j,i) is a rectangular area with length and width s, and the center of the area is the pixel point (j,i). r is the window radius. The filtering weight WD is a three- dimensional weight with a space of h×w×s 2 , and the weight can be obtained by training a three-dimensional joint denoising convolutional neural network. Illustratively, as shown in FIG. 3 . The processing flow at the image level may include: first, using the input image: the second soft exposure image I SE and the alignment image I LA to construct a second four-dimensional feature V D with a space of h×w×s 2 ×m; After the two- and four-dimensional features V D , the present invention uses a three-dimensional U-shaped network to learn the filtering weights W D from them. The three-dimensional U-shaped network is similar to the traditional U-shaped network, except that the present invention uses three-dimensional convolution instead of two-dimensional convolution. After obtaining the filtering weight WD, the denoised image can be obtained by formula (2) The processing flow at the pixel level for each pixel point (j, i): the rectangular area centered on the pixel point, that is, the two-dimensional adjacent pixel area Ω(j, i) needs to be reshaped into a one-dimensional slice; for For each pixel (j',i') in Ω(j,i), the eigenvalue and weight value of the second four-dimensional feature V D and the filtering weight WD are respectively and The four-dimensional feature corresponding to the pixel point (j',i') of each Ω(j,i) area and the central pixel point (j,i) is composed of the pixel point (j',i') in I SE and I SA The pixel value, the pixel value of the center point ( j , i) of the ISA, and the geometric distance D gm ((j', i')( j,i))=(j-j') 2 +(i-i') 2 are jointly determined, that is, the following formula:
其中,Concat代表张量连接,Vj,i,(j'-j+r)·s+(i'-i+r)代表第二四维特征的元素点(jV,iV,(j'V-jV+r)·s+(i'V-iV+r))的特征值,代表像素点(j’,i’)在第二软曝光图像上的像素值,代表像素点(j,i)在对齐图像上的像素值,代表像素点(j,i)的第二软曝光图像上的像素值。其中,(j’,i’)和(j,i)均为第二软曝光图像中的像素点。Dgm((j',i')(j,i))代表像素点(j,i)与像素点(j’,i’)两点间的几何距离。 Among them, Concat represents tensor connection, V j,i,(j'-j+r) s+(i'-i+r) represents the element point of the second four-dimensional feature (j V ,i V ,(j' The eigenvalues of V -j V +r) s+(i' V -i V +r)), represents the pixel value of the pixel point (j', i') on the second soft exposure image, represents the pixel value of the pixel point (j, i) on the aligned image, Pixel value on the second soft exposure image representing pixel point (j,i). Wherein, (j', i') and (j, i) are both pixel points in the second soft exposure image. D gm ((j',i')(j,i)) represents the geometric distance between the pixel point (j,i) and the pixel point (j',i').
在三维联合降噪卷积神经网络的训练中,本发明使用结构相似性SSIM作为度量函数,并将损失函数定义为:In the training of the three-dimensional joint denoising convolutional neural network, the present invention uses the structural similarity SSIM as the metric function, and defines the loss function as:
其中,L1为第二损失函数,GSE是主图像的实际真实长曝光图像,α是全局调整曲线。本发明进行全局调整,使降噪图像和实际的真实长曝光图像GSE之间的曝光差异最小化,从而避免这种差异影响降噪质量的评价。全局调整曲线α是由降噪图像和实际的真实长曝光图像GSE估算得到,包含动态范围为0-255的256个点。其中,全局调整曲线α中每个点的计算方法如下公式(3):where L 1 is the second loss function, G SE is the actual real long-exposure image of the main image, and α is the global adjustment curve. The present invention performs global adjustment to make noise-reduced images The exposure difference between GSE and the actual real long-exposure image G SE is minimized, so as to avoid this difference from affecting the evaluation of noise reduction quality. The global adjustment curve α is determined by denoising the image and the actual real long-exposure image G SE is estimated, including 256 points with a dynamic range of 0-255. Among them, the calculation method of each point in the global adjustment curve α is as follows:
其中,对应于公式(3),χ'具体取值为降噪图像中像素点(j,i)的像素值χ具体取值为实际的真实长曝光图像GSE中像素点的像素值。in, Corresponding to formula (3), the specific value of χ' is the pixel value of the pixel point (j, i) in the noise reduction image The specific value of χ is the pixel value of the pixel point in the actual real long-exposure image G SE .
在一种可选的实施方式中,上述对短曝光图像和降噪图像进行融合,得到高动态范围图像,具体可以包括如下步骤:In an optional implementation manner, the above-mentioned fusion of the short exposure image and the noise reduction image to obtain a high dynamic range image may specifically include the following steps:
将短曝光图像和降噪图像,输入预先训练得到的图像融合卷积神经子网络,以使得图像融合卷积神经子网络对短曝光图像和所述降噪图像进行融合,得到高动态范围图像;The short-exposure image and the noise-reduced image are input into the pre-trained image fusion convolutional neural sub-network, so that the image fusion convolutional neural sub-network fuses the short-exposure image and the noise-reduced image to obtain a high dynamic range image;
其中,图像融合卷积神经子网络为利用多个样本短曝光图像,多个样本降噪图像以及每个样本短曝光图像对应的真实高动态范围图像训练得到的网络;任一样本短曝光图像对应的真实高动态范围图像为用于采集高动态范围图像的相机在该样本短曝光图像的采集时刻采集的图像。Among them, the image fusion convolutional neural sub-network is a network trained by using multiple sample short exposure images, multiple sample noise reduction images and real high dynamic range images corresponding to each sample short exposure image; any sample short exposure image corresponds to The real high dynamic range image is the image acquired by the camera used to acquire the high dynamic range image at the acquisition moment of the short exposure image of the sample.
在一种可选的实施方式中,上述图像融合卷积神经子网络对短曝光图像和降噪图像进行融合,得到高动态范围图像,具体可以包括如下步骤:In an optional embodiment, the above-mentioned image fusion convolutional neural sub-network fuses the short-exposure image and the noise reduction image to obtain a high dynamic range image, which may specifically include the following steps:
利用预先设置的调和权重对短曝光图像和降噪图像进行加权处理,得到高动态范围图像。The short-exposure image and the noise-reduced image are weighted by the preset harmonic weight to obtain the high dynamic range image.
在具体应用中,上述图像融合卷积神经网络的输入可以包括短曝光图像IS与降噪图像该图像融合卷积神经网络直接建立了一个残差网络去学习短曝光图像IS与降噪图像在每个像素点的融合权重,以得到高动态范围图像IHDR,如下式:In a specific application, the input of the above-mentioned image fusion convolutional neural network may include a short exposure image IS and a denoised image The image fusion convolutional neural network directly establishes a residual network to learn the short exposure image IS and the denoised image The fusion weight at each pixel point to obtain the high dynamic range image I HDR , as follows:
其中,WB为融合权重。 Among them, WB is the fusion weight.
在图像融合卷积神经网络的训练中,本发明使用结构相似性SSIM作为度量函数,并将损失函数定义为:In the training of the image fusion convolutional neural network, the present invention uses the structural similarity SSIM as the metric function, and defines the loss function as:
L3=1-SSIM(IHDR,GHDR);L 3 =1-SSIM(I HDR , G HDR );
其中,L3为第三损失函数,GHDR是实际的真实高动态范围图像。Among them, L 3 is the third loss function, and G HDR is the actual real high dynamic range image.
示例性的,本发明可以使用TensorFlow(一个核心开源库,可以用于开发和训练机器学习模型)实现。所有神经网络使用RMSProp(Root Mean Square prop,是一种用于深度学习梯度计算的方法)优化,学习率设为0.001。将用于训练的数据集中的图像随机分为包含700对图像的训练集和包含300对图像的测试集。所有程序代码可以运行在带有英特尔I7处理器和4块NVIDIA 1080Ti GPU的服务器上。在训练阶段,本发明使用来自数据集的分辨率为416x576的图像。在测试阶段,本发明测试了三个分辨率级别,即分辨率级别level1:832x1184)、分辨率级别level2:416x576和分辨率级别level3:192x288。Exemplarily, the present invention can be implemented using TensorFlow, a core open source library that can be used to develop and train machine learning models. All neural networks are optimized using RMSProp (Root Mean Square prop, a method for gradient computation in deep learning) with learning rate set to 0.001. The images in the dataset used for training were randomly divided into a training set containing 700 pairs of images and a test set containing 300 pairs of images. All program codes can be run on a server with Intel I7 processor and 4 NVIDIA 1080Ti GPUs. In the training phase, the present invention uses images from the dataset with a resolution of 416x576. In the testing stage, the present invention tests three resolution levels, namely, resolution level 1: 832×1184), resolution level 2: 416×576, and resolution level 3: 192×288.
为了便于理解,对上述本发明实施例和可选实施例进行整合,得到本发明另一实施例提供的一种面向双镜头相机的无重影高动态范围成像方法,下面以示例性说明的形式进行具体描述。示例性的,如图4所示。利用长曝光图像IL对短曝光图像IS进行曝光调整实现软曝光,得到软曝光结果:第一软曝光图像ISE’。将长曝光图像IL和第一软曝光图像ISE’,输入图像匹配卷积神经网络即相对于整个成像方法的图像匹配卷积神经子网络,得到对齐结果:对齐图像ILA。利用对齐图像ILA对短曝光图像IS进行曝光调整实现软曝光,得到第软曝光结果:第二软曝光图像ISE。步骤B2,将对齐图像ILA和第二软曝光图像ISE,输入三维联合降噪卷积神经网络即对于整个成像方法的三维引导降噪卷积神经子网络,得到联合降噪结果:降噪图像将短曝光图像IS和降噪图像输入图像融合卷积神经网络即对于整个成像方法的图像融合卷积神经子网络,得到高动态范围成像结果:高动态范围图像IHDR。For ease of understanding, the above embodiments of the present invention and optional embodiments are integrated to obtain a ghost-free high dynamic range imaging method for a dual-lens camera provided by another embodiment of the present invention. The following is in the form of an exemplary description. Describe in detail. Exemplarily, as shown in FIG. 4 . Using the long-exposure image IL to adjust the exposure of the short-exposure image IS to achieve soft exposure, a soft-exposure result is obtained: the first soft-exposure image I SE ' . The long exposure image IL and the first soft exposure image I SE' are input to the image matching convolutional neural network, that is, the image matching convolutional neural sub-network relative to the entire imaging method, to obtain an alignment result: the aligned image I LA . Using the alignment image I LA to adjust the exposure of the short-exposure image IS to achieve soft exposure, the first soft-exposure result is obtained: the second soft-exposure image I SE . In step B2, the alignment image I LA and the second soft exposure image I SE are input into the three-dimensional joint noise reduction convolutional neural network, that is, the three-dimensional guided noise reduction convolutional neural sub-network for the entire imaging method, and the joint noise reduction result is obtained: noise reduction image The short-exposure image IS and the noise-reduced image The input image fusion convolutional neural network is the image fusion convolutional neural sub-network for the entire imaging method, and a high dynamic range imaging result is obtained: the high dynamic range image I HDR .
相应于上述方法实施例,本发明实施例还提供一种面向双镜头相机的无重影高动态范围成像装置。Corresponding to the above method embodiments, the embodiments of the present invention further provide a ghost-free high dynamic range imaging device for a dual-lens camera.
如图5所示,本发明一实施例提供的一种面向双镜头相机的无重影高动态范围成像装置的结构,该装置可以包括:As shown in FIG. 5 , an embodiment of the present invention provides a structure of a dual-lens camera-oriented high dynamic range imaging device without ghosting. The device may include:
输入获取模块501,用于获取双镜头相机在同一时刻采集的一张长曝光图像和一张短曝光图像;An
图像处理模块502,用于将所述长曝光图像和所述短曝光图像输入无重影高动态范围成像的主图像增强模型,以使得所述主图像增强模型执行如下操作,获得高动态范围图像:The
基于所述短曝光图像,对所述长曝光图像进行对齐调整,获得对齐图像;Based on the short exposure image, performing alignment adjustment on the long exposure image to obtain an alignment image;
基于所述对齐图像,对所述短曝光图像进行曝光调整以及降噪处理,获得降噪图像;Based on the alignment image, performing exposure adjustment and noise reduction processing on the short exposure image to obtain a noise reduction image;
对所述短曝光图像和所述降噪图像进行融合,得到所述高动态范围图像。The short exposure image and the noise reduction image are fused to obtain the high dynamic range image.
本发明实施例提供的方案中,基于对齐图像对短曝光图像进行曝光调整以及降噪处理,得到降噪图像,可以保证对齐图像对曝光调整和降噪处理产生贡献。因此,可以在将对齐图像包含的信息通过曝光调整和降噪处理加入降噪图像的同时,保证降噪图像中像素的位置不会受到对齐图像的影响,避免重影的产生,进而对短曝光图像和降噪图像进行融合,得到的高动态范围图像不存在重影。可见,通过本方案,可以获得面向双镜头相机的无重影的高动态范围图像,提高双镜头相机的成像质量。In the solution provided by the embodiment of the present invention, exposure adjustment and noise reduction processing are performed on the short-exposure image based on the aligned image to obtain a noise reduction image, which can ensure that the aligned image contributes to exposure adjustment and noise reduction processing. Therefore, the information contained in the alignment image can be added to the denoised image through exposure adjustment and noise reduction, while ensuring that the position of the pixels in the denoised image will not be affected by the alignment image, avoiding the generation of ghosting, and further reducing short exposures. The image and the denoised image are fused, and the resulting high dynamic range image has no ghosting. It can be seen that through this solution, a ghost-free high dynamic range image for the dual-lens camera can be obtained, and the imaging quality of the dual-lens camera can be improved.
在一种可选的实施方式中,上述图像处理模块502,具体用于:In an optional implementation manner, the above-mentioned
利用所述长曝光图像对所述短曝光图像进行曝光调整,得到第一软曝光图像;Performing exposure adjustment on the short-exposure image by using the long-exposure image to obtain a first soft-exposure image;
将所述长曝光图像和所述第一软曝光图像,输入预先训练得到的图像匹配卷积神经子网络,以使得所述图像匹配卷积神经子网络将所述长曝光图像调整为与所述第一软曝光图像对齐的图像,得到对齐图像;The long-exposure image and the first soft-exposure image are input into a pre-trained image-matching convolutional neural sub-network, so that the image-matching convolutional neural sub-network adjusts the long-exposure image to match the The first soft-exposure image is aligned with the image to obtain an aligned image;
其中,所述图像匹配卷积神经子网络为利用多个样本长曝光图像,多个样本短曝光图像以及每个样本短曝光图像分别对应的真实长曝光图像训练得到的网络;任一短曝光图像对应的真实长曝光图像为所述双镜头相机对该短曝光图像进行物理长曝光得到的图像。The image matching convolutional neural sub-network is a network trained by using multiple sample long-exposure images, multiple sample short-exposure images, and real long-exposure images corresponding to each sample short-exposure image; any short-exposure image The corresponding real long-exposure image is an image obtained by performing physical long-exposure on the short-exposure image by the dual-lens camera.
本发明实施例还提供了一种电子设备,如图6所示,包括处理器601、通信接口602、存储器603和通信总线604,其中,处理器601,通信接口602,存储器603通过通信总线604完成相互间的通信,An embodiment of the present invention further provides an electronic device, as shown in FIG. 6 , including a
存储器603,用于存放计算机程序;a
处理器601,用于执行存储器603上所存放的程序时,实现如下步骤:When the
获取双镜头相机在同一时刻采集的一张长曝光图像和一张短曝光图像;Obtain a long-exposure image and a short-exposure image captured by the dual-lens camera at the same moment;
将所述长曝光图像和所述短曝光图像输入无重影高动态范围成像的主图像增强模型,以使得所述主图像增强模型执行如下操作,获得高动态范围图像:The long-exposure image and the short-exposure image are input into a main image enhancement model for ghost-free high dynamic range imaging, so that the main image enhancement model performs the following operations to obtain a high dynamic range image:
基于所述短曝光图像,对所述长曝光图像进行对齐调整,获得对齐图像;Based on the short exposure image, performing alignment adjustment on the long exposure image to obtain an alignment image;
基于所述对齐图像,对所述短曝光图像进行曝光调整以及降噪处理,获得降噪图像;Based on the alignment image, performing exposure adjustment and noise reduction processing on the short exposure image to obtain a noise reduction image;
对所述短曝光图像和所述降噪图像进行融合,得到所述高动态范围图像。The short exposure image and the noise reduction image are fused to obtain the high dynamic range image.
本发明实施例提供的方案中,基于对齐图像对短曝光图像进行曝光调整以及降噪处理,得到降噪图像,可以保证对齐图像对曝光调整和降噪处理产生贡献。因此,可以在将对齐图像包含的信息通过曝光调整和降噪处理加入降噪图像的同时,保证降噪图像中像素的位置不会受到对齐图像的影响,避免重影的产生,进而对短曝光图像和降噪图像进行融合,得到的高动态范围图像不存在重影。可见,通过本方案,可以获得面向双镜头相机的无重影的高动态范围图像,提高双镜头相机的成像质量。In the solution provided by the embodiment of the present invention, exposure adjustment and noise reduction processing are performed on the short-exposure image based on the aligned image to obtain a noise reduction image, which can ensure that the aligned image contributes to exposure adjustment and noise reduction processing. Therefore, the information contained in the alignment image can be added to the denoised image through exposure adjustment and noise reduction, while ensuring that the position of the pixels in the denoised image will not be affected by the alignment image, avoiding the generation of ghosting, and further reducing short exposures. The image and the denoised image are fused, and the resulting high dynamic range image has no ghosting. It can be seen that through this solution, a ghost-free high dynamic range image for the dual-lens camera can be obtained, and the imaging quality of the dual-lens camera can be improved.
上述电子设备提到的通信总线可以是外设部件互连标准(Peripheral ComponentInterconnect,PCI)总线或扩展工业标准结构(Extended Industry StandardArchitecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned in the above electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus or the like. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
通信接口用于上述电子设备与其他设备之间的通信。The communication interface is used for communication between the above electronic device and other devices.
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include random access memory (Random Access Memory, RAM), or may include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital SignalProcessor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
在本发明提供的又一实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述任一面向双镜头相机的无重影高动态范围成像方法的步骤。In another embodiment provided by the present invention, a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any one of the above-mentioned dual-camera orientations is implemented Steps of a camera's ghost-free high dynamic range imaging method.
在本发明提供的又一实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述实施例中任一面向双镜头相机的无重影高动态范围成像方法。In yet another embodiment provided by the present invention, there is also provided a computer program product including instructions, which, when run on a computer, enables the computer to execute any of the above-mentioned embodiments of the dual-lens camera-oriented ghost-free high dynamic Range imaging method.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, Solid State Disk (SSD)), among others.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for related parts.
以上所述仅为本发明的较佳实施例,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011460648.9A CN112689099B (en) | 2020-12-11 | 2020-12-11 | A ghost-free high dynamic range imaging method and device for a dual-lens camera |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011460648.9A CN112689099B (en) | 2020-12-11 | 2020-12-11 | A ghost-free high dynamic range imaging method and device for a dual-lens camera |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112689099A CN112689099A (en) | 2021-04-20 |
CN112689099B true CN112689099B (en) | 2022-03-22 |
Family
ID=75449251
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011460648.9A Expired - Fee Related CN112689099B (en) | 2020-12-11 | 2020-12-11 | A ghost-free high dynamic range imaging method and device for a dual-lens camera |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112689099B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113835462A (en) * | 2021-09-13 | 2021-12-24 | 星宸科技股份有限公司 | Control circuit and control method of image sensor |
CN116033274B (en) * | 2023-02-27 | 2023-06-09 | 江苏游隼微电子有限公司 | 3D-noise-reduction-compatible image width dynamic method |
WO2024221411A1 (en) * | 2023-04-28 | 2024-10-31 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Image processing device, method, and program |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020051305A1 (en) * | 2018-09-07 | 2020-03-12 | Dolby Laboratories Licensing Corporation | Auto exposure of spatially-multiplexed-exposure high-dynamic-range image sensors |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4661922B2 (en) * | 2008-09-03 | 2011-03-30 | ソニー株式会社 | Image processing apparatus, imaging apparatus, solid-state imaging device, image processing method, and program |
JP5978949B2 (en) * | 2012-03-16 | 2016-08-24 | 富士通株式会社 | Image composition apparatus and computer program for image composition |
JP6020199B2 (en) * | 2013-01-24 | 2016-11-02 | 株式会社ソシオネクスト | Image processing apparatus, method, program, and imaging apparatus |
CN110832541B (en) * | 2017-06-28 | 2022-10-04 | 华为技术有限公司 | Image processing device and method |
CN107507234B (en) * | 2017-08-29 | 2019-11-01 | 北京大学 | Cone beam computed tomography image and x-ray image method for registering |
CN107808365A (en) * | 2017-09-30 | 2018-03-16 | 广州智慧城市发展研究院 | One kind is based on the self-compressed image denoising method of convolutional neural networks and system |
CN110121882B (en) * | 2017-10-13 | 2020-09-08 | 华为技术有限公司 | An image processing method and device |
CN108492245B (en) * | 2018-02-06 | 2020-06-30 | 浙江大学 | Low-luminosity image pair fusion method based on wavelet decomposition and bilateral filtering |
CN109040524B (en) * | 2018-08-16 | 2021-06-29 | Oppo广东移动通信有限公司 | Artifact removal method, device, storage medium and terminal |
US11107205B2 (en) * | 2019-02-18 | 2021-08-31 | Samsung Electronics Co., Ltd. | Techniques for convolutional neural network-based multi-exposure fusion of multiple image frames and for deblurring multiple image frames |
-
2020
- 2020-12-11 CN CN202011460648.9A patent/CN112689099B/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020051305A1 (en) * | 2018-09-07 | 2020-03-12 | Dolby Laboratories Licensing Corporation | Auto exposure of spatially-multiplexed-exposure high-dynamic-range image sensors |
Also Published As
Publication number | Publication date |
---|---|
CN112689099A (en) | 2021-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112689099B (en) | A ghost-free high dynamic range imaging method and device for a dual-lens camera | |
Ruan et al. | AIFNet: All-in-focus image restoration network using a light field-based dataset | |
CN110969066B (en) | Live video identification method and device and electronic equipment | |
WO2022134971A1 (en) | Noise reduction model training method and related apparatus | |
CN108961184B (en) | A depth image correction method, device and device | |
Sil et al. | Convolutional neural networks for noise classification and denoising of images | |
CN113066065B (en) | No-reference image quality detection method, system, terminal and medium | |
WO2021082819A1 (en) | Image generation method and apparatus, and electronic device | |
US12315075B2 (en) | Object-centric neural decomposition for image re-rendering | |
CN116830578B (en) | Method and apparatus for reduced quantization latency | |
CN113228096A (en) | Optical correction by machine learning | |
CN114170654A (en) | Training method of age recognition model, face age recognition method and related device | |
CN115953317A (en) | Image enhancement method, device, electronic equipment and storage medium | |
Yang et al. | Aberration-aware depth-from-focus | |
Lin et al. | Non-blind optical degradation correction via frequency self-adaptive and finetune tactics | |
CN114861842A (en) | Few-sample target detection method and device and electronic equipment | |
CN110401488B (en) | A demodulation method and device | |
Ji et al. | Learned large field-of-view imager with a simple spherical optical module | |
CN114638375A (en) | Video generation model training method, video generation method and device | |
WO2025082530A1 (en) | Feature sampling method and apparatus, deep learning method and apparatus, device, and medium | |
JP2024038523A (en) | Image processing method, learned model manufacturing method, program, and image processing device | |
CN117611455A (en) | Underwater image enhancement method and system based on generation countermeasure network | |
CN116309226A (en) | Image processing method and related equipment thereof | |
CN116071804A (en) | Face recognition method and device and electronic equipment | |
CN115689947A (en) | Image sharpening method, system, electronic device 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20220322 |
|
CF01 | Termination of patent right due to non-payment of annual fee |