CN105578068B - A kind of generation method of high dynamic range images, device and mobile terminal - Google Patents
A kind of generation method of high dynamic range images, device and mobile terminal Download PDFInfo
- Publication number
- CN105578068B CN105578068B CN201510973323.3A CN201510973323A CN105578068B CN 105578068 B CN105578068 B CN 105578068B CN 201510973323 A CN201510973323 A CN 201510973323A CN 105578068 B CN105578068 B CN 105578068B
- Authority
- CN
- China
- Prior art keywords
- image
- brightness
- processed
- hdr
- generating
- 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
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000004364 calculation method Methods 0.000 claims description 12
- 230000000694 effects Effects 0.000 description 3
- 238000005375 photometry Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 102000002067 Protein Subunits Human genes 0.000 description 1
- 108010001267 Protein Subunits Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/741—Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
本发明实施例公开了一种高动态范围图像的生成方法、装置及移动终端。该方法包括:计算当前缓存图像的亮度加权平均值,其中,亮度值高于第一亮度阈值的区域的权重高于其他区域的权重;根据由亮度加权平均值确定的曝光参数来控制摄像头捕捉图像,作为待处理图像;提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像。本发明实施例通过采用上述技术方案,可有效提高HDR图像的动态范围,且该方法不需要拍摄多张照片来合成HDR图像,可提升处理速度,实现快速拍照。
The embodiment of the invention discloses a method, a device and a mobile terminal for generating a high dynamic range image. The method includes: calculating a brightness-weighted average value of the current cached image, wherein the weight of an area whose brightness value is higher than a first brightness threshold is higher than that of other areas; and controlling the camera to capture an image according to an exposure parameter determined by the brightness-weighted average value , as an image to be processed; increasing the brightness of a region whose brightness value is lower than a second brightness threshold in the image to be processed, and generating an HDR image. The embodiment of the present invention can effectively improve the dynamic range of the HDR image by adopting the above technical solution, and the method does not need to take multiple photos to synthesize the HDR image, which can increase the processing speed and realize fast photographing.
Description
技术领域technical field
本发明实施例涉及图像处理技术领域,尤其涉及一种高动态范围图像的生成方法、装置及移动终端。Embodiments of the present invention relate to the technical field of image processing, and in particular to a method, device and mobile terminal for generating a high dynamic range image.
背景技术Background technique
高动态范围(High Dynamic Range,HDR)图像与普通图像相比,可提供更多的动态范围和图像细节,能够更好的反映人真实环境中的视觉效果。Compared with ordinary images, high dynamic range (High Dynamic Range, HDR) images can provide more dynamic range and image details, and can better reflect the visual effect of people in the real environment.
目前,许多数码相机以及配置有摄像头的手机等移动终端都支持HDR拍照模式,该模式尤其适用于在逆光的拍摄环境中拍照。在当前环境为逆光状态时,普通拍照模式由于动态范围不足,所拍摄的照片往往会出现亮处过曝或暗处欠曝的问题,采用HDR拍照模式可有效改善该问题。At present, many mobile terminals such as digital cameras and mobile phones equipped with cameras support the HDR camera mode, which is especially suitable for taking pictures in a backlit shooting environment. When the current environment is backlit, due to the lack of dynamic range in the normal camera mode, the photos taken often have the problem of overexposure in bright areas or underexposure in dark areas. Using HDR camera mode can effectively improve this problem.
现有的HDR拍照模式中,通常需要拍摄多张同一场景的不同曝光程度的照片,将这些照片进行合成,生成HDR图像。例如,拍摄三张亮度分别为较亮、中等亮度和较暗的照片,在通过软件合成时,将中等亮度照片中相对曝光不足的部分图像用较亮照片中对应的部分图像代替,而相对曝光过度的部分图像用较暗照片中对应的部分图像代替,最终合成HDR图像,该方案需要拍摄多张不同亮度照片,速度较慢,无法满足用户需求。In the existing HDR camera mode, it is usually necessary to take a plurality of photos of the same scene with different exposure levels, and synthesize these photos to generate an HDR image. For example, take three photos with brighter brightness, medium brightness and darker brightness respectively. When compositing through software, the relatively underexposed part of the image in the medium brightness photo will be replaced by the corresponding part of the image in the brighter photo, while the relative exposure The excessive part of the image is replaced by the corresponding part of the image in the darker photo, and finally the HDR image is synthesized. This solution needs to take multiple photos with different brightness, which is slow and cannot meet the needs of users.
发明内容Contents of the invention
本发明实施例的目的是提供一种高动态范围图像的生成方法、装置及移动终端,以解决现有的高动态范围图像生成方案处理速度慢的问题。The purpose of the embodiments of the present invention is to provide a method, device and mobile terminal for generating a high dynamic range image, so as to solve the problem of slow processing speed of the existing high dynamic range image generation scheme.
第一方面,本发明实施例提供了一种高动态范围图像的生成方法,包括:In a first aspect, an embodiment of the present invention provides a method for generating a high dynamic range image, including:
计算当前缓存图像的亮度加权平均值,其中,亮度值高于第一亮度阈值的区域的权重高于其他区域的权重;Calculating the brightness weighted average value of the current cached image, wherein the weight of the region whose brightness value is higher than the first brightness threshold is higher than the weight of other regions;
根据由所述亮度加权平均值确定的曝光参数来控制摄像头捕捉图像,作为待处理图像;Control the camera to capture an image according to the exposure parameters determined by the brightness weighted average value as the image to be processed;
提升所述待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像。Raise the brightness of an area whose brightness value is lower than the second brightness threshold in the image to be processed, and generate an HDR image.
第二方面,本发明实施例提供了一种高动态范围图像的生成装置,包括:In a second aspect, an embodiment of the present invention provides a device for generating a high dynamic range image, including:
亮度加权平均值计算模块,用于计算当前缓存图像的亮度加权平均值,其中,亮度值高于第一亮度阈值的区域的权重高于其他区域的权重;The brightness weighted average calculation module is used to calculate the brightness weighted average of the current cached image, wherein the weight of the region whose brightness value is higher than the first brightness threshold is higher than the weight of other regions;
图像捕捉控制模块,用于根据由所述亮度加权平均值确定的曝光参数来控制摄像头捕捉图像,作为待处理图像;An image capture control module, configured to control the camera to capture an image as an image to be processed according to the exposure parameters determined by the brightness weighted average;
HDR图像生成模块,用于提升所述待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像。The HDR image generation module is configured to increase the brightness of an area whose brightness value is lower than the second brightness threshold in the image to be processed, and generate an HDR image.
第三方面,本发明实施例还提供了一种集成了前述高动态范围图像的生成装置的移动终端。In a third aspect, an embodiment of the present invention further provides a mobile terminal integrated with the foregoing high dynamic range image generating device.
本发明实施例中提供的高动态范围图像的生成方案,计算当前缓存图像的亮度加权平均值,并提升了亮度值高于第一亮度阈值的区域的权重,相比与现有方案中计算亮度平均值来说,所计算出来的图像整体亮度值更高,依此确定的曝光参数可保证在控制摄像头捕捉图像时,亮区不会出现曝光过度的情况。将以上述曝光参数捕捉的图像作为待处理图像,提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像,可有效提高HDR图像的动态范围,且该方案不需要拍摄多张照片来合成HDR图像,可提升处理速度,实现快速拍照。The high dynamic range image generation scheme provided in the embodiment of the present invention calculates the brightness weighted average value of the current cached image, and increases the weight of the area whose brightness value is higher than the first brightness threshold, compared with the calculation of brightness in the existing scheme On average, the calculated overall brightness value of the image is higher, and the exposure parameters determined based on this can ensure that when the camera is controlled to capture the image, the bright area will not be overexposed. The image captured with the above exposure parameters is used as the image to be processed, and the brightness of the region whose brightness value is lower than the second brightness threshold in the image to be processed is increased, and an HDR image is generated, which can effectively improve the dynamic range of the HDR image, and this solution does not require Taking multiple photos to synthesize HDR images can improve the processing speed and achieve fast photo taking.
附图说明Description of drawings
图1为本发明实施例一提供的一种高动态范围图像的生成方法的流程示意图;FIG. 1 is a schematic flowchart of a method for generating a high dynamic range image provided by Embodiment 1 of the present invention;
图2为本发明实施例二提供的一种高动态范围图像的生成方法的流程示意图;FIG. 2 is a schematic flowchart of a method for generating a high dynamic range image provided by Embodiment 2 of the present invention;
图3为本发明实施例三提供的一种优选的高动态范围图像的生成方法的流程示意图;FIG. 3 is a schematic flowchart of a preferred method for generating a high dynamic range image provided by Embodiment 3 of the present invention;
图4为本发明实施例四提供的一种高动态范围图像的生成装置的结构框图。FIG. 4 is a structural block diagram of an apparatus for generating a high dynamic range image according to Embodiment 4 of the present invention.
具体实施方式Detailed ways
下面结合附图并通过具体实施方式来进一步说明本发明的技术方案。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The technical solutions of the present invention will be further described below in conjunction with the accompanying drawings and through specific implementation methods. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings but not all structures.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processing, many of the steps may be performed in parallel, concurrently, or simultaneously. Additionally, the order of steps may be rearranged. The process may be terminated when its operations are complete, but may also have additional steps not included in the figure. The processing may correspond to a method, function, procedure, subroutine, subroutine, or the like.
实施例一Embodiment one
图1为本发明实施例一提供的一种高动态范围图像的生成方法的流程示意图,该方法可以由高动态范围图像的生成装置执行,其中该装置可由软件和/或硬件实现,一般可集成在移动终端中。如图1所示,该方法包括:Fig. 1 is a schematic flowchart of a method for generating a high dynamic range image provided by Embodiment 1 of the present invention, the method can be executed by a device for generating a high dynamic range image, wherein the device can be implemented by software and/or hardware, and generally can be integrated in the mobile terminal. As shown in Figure 1, the method includes:
步骤101、计算当前缓存图像的亮度加权平均值。Step 101. Calculate the brightness weighted average value of the current cached image.
其中,亮度值高于第一亮度阈值的区域的权重高于其他区域的权重。Wherein, weights of regions whose luminance values are higher than the first luminance threshold are higher than weights of other regions.
示例性的,本实施例中的移动终端具体可为手机、平板电脑以及数码照相机等终端,优选为智能手机。Exemplarily, the mobile terminal in this embodiment may specifically be a terminal such as a mobile phone, a tablet computer, and a digital camera, preferably a smart phone.
示例性的,当前缓存图像可依据亮度分布情况被划分为多个区域,每个区域可包括一个或者多个像素。示例性的,一个区域的亮度值具体可为该区域中包含的所有像素的平均值。所述第一亮度阈值可由系统默认设置,也可由用户根据个人习惯进行设置。第一亮度阈值可以是一个固定的亮度值,也可以是一个动态调整的亮度值。例如,当第一亮度阈值被设置为一个动态调整的亮度值时,可将其设置为当前缓存图像的亮度平均值的预设比例值,如120%。Exemplarily, the current cached image may be divided into multiple regions according to the brightness distribution, and each region may include one or more pixels. Exemplarily, the brightness value of an area may specifically be an average value of all pixels included in the area. The first brightness threshold can be set by default by the system, or can be set by the user according to personal habits. The first brightness threshold may be a fixed brightness value, or a dynamically adjusted brightness value. For example, when the first brightness threshold is set as a dynamically adjusted brightness value, it may be set as a preset ratio value of the average brightness value of the currently cached image, such as 120%.
示例性的,亮度值高于第一亮度阈值的区域的权重以及其他区域的权重也可由系统默认设置,或由用户根据个人习惯进行设置。Exemplarily, the weights of the regions whose luminance values are higher than the first luminance threshold and the weights of other regions may also be set by default by the system, or set by the user according to personal habits.
示例性的,可采用全局测光方式来获取当前缓存图像的测光数据,测光数据中可包含每个像素的亮度值。Exemplarily, the global light metering method may be used to acquire the light metering data of the current cached image, and the light metering data may include the brightness value of each pixel.
步骤102、根据由亮度加权平均值确定的曝光参数来控制摄像头捕捉图像,作为待处理图像。Step 102: Control the camera to capture an image according to the exposure parameter determined by the brightness weighted average value as the image to be processed.
示例性的,所述曝光参数可包括曝光时间。现有方案中通常以图像的亮度平均值来衡量图像整体亮度,并根据亮度平均值来确定曝光时间。本实施例中,采用步骤101中所计算的亮度加权平均值来衡量图像整体亮度,在计算过程中,提升了亮度值高于第一亮度阈值的区域的权重,所以该亮度加权平均值高于现有方案中的亮度平均值,依此确定的曝光时间更短,可保证在根据该曝光时间控制摄像头捕捉图像时,亮区不会出现曝光过度的情况。Exemplarily, the exposure parameters may include exposure time. In existing solutions, the overall brightness of the image is usually measured by the average brightness of the image, and the exposure time is determined according to the average brightness. In this embodiment, the brightness weighted average value calculated in step 101 is used to measure the overall brightness of the image. During the calculation process, the weight of the region whose brightness value is higher than the first brightness threshold is increased, so the brightness weighted average value is higher than The exposure time determined based on the average brightness value in the existing solution is shorter, which can ensure that when the camera is controlled to capture images according to the exposure time, the bright area will not be overexposed.
步骤103、提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像。Step 103, increasing the brightness of an area whose brightness value is lower than a second brightness threshold in the image to be processed, and generating an HDR image.
示例性的,由于缩短了曝光时间,待处理图像的整体亮度会降低,为了保证暗处的细节不丢失,本步骤对待处理图像中亮度值低于第二亮度阈值的区域(暗处区域)做亮度提升处理,以表现暗处的更多细节。所述第二亮度阈值可由系统默认设置,也可由用户根据个人习惯进行设置。第二亮度阈值可以是一个固定的亮度值,也可以是一个动态调整的亮度值。Exemplarily, since the exposure time is shortened, the overall brightness of the image to be processed will decrease. In order to ensure that the details in the dark are not lost, this step performs Brightness enhancement processing to show more details in dark places. The second brightness threshold can be set by default by the system, or can be set by the user according to personal habits. The second brightness threshold may be a fixed brightness value, or a dynamically adjusted brightness value.
示例性的,可计算能够将暗处区域调整至合适亮度的伽马(Gamma)参数(如Gamma曲线),并根据Gamma参数对待处理图像进行调整,最后生成动态范围更广、图像细节更多的HDR图像。Exemplarily, it is possible to calculate the gamma (Gamma) parameter (such as the Gamma curve) that can adjust the dark area to an appropriate brightness, and adjust the image to be processed according to the Gamma parameter, and finally generate a wider dynamic range and more image details. HDR images.
本发明实施例一提供的高动态范围图像的生成方法,计算当前缓存图像的亮度加权平均值,并提升了亮度值高于第一亮度阈值的区域的权重,相比与现有方案中计算亮度平均值来说,所计算出来的图像整体亮度值更高,依此确定的曝光参数可保证在控制摄像头捕捉图像时,亮区不会出现曝光过度的情况。将以上述曝光参数捕捉的图像作为待处理图像,提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像,可有效提高HDR图像的动态范围,且该方法不需要拍摄多张照片来合成HDR图像,可提升处理速度,实现快速拍照。The high dynamic range image generation method provided by Embodiment 1 of the present invention calculates the weighted average value of the brightness of the current cached image, and increases the weight of the region whose brightness value is higher than the first brightness threshold, compared with the calculation of brightness in the existing scheme On average, the calculated overall brightness value of the image is higher, and the exposure parameters determined based on this can ensure that when the camera is controlled to capture the image, the bright area will not be overexposed. The image captured with the above exposure parameters is used as the image to be processed, and the brightness of the region whose brightness value is lower than the second brightness threshold in the image to be processed is increased, and an HDR image is generated, which can effectively improve the dynamic range of the HDR image, and this method does not require Taking multiple photos to synthesize HDR images can improve the processing speed and achieve fast photo taking.
实施例二Embodiment two
图2为本发明实施例二提供的一种高动态范围图像的生成方法的流程示意图,本实施例以上述实施例为基础进行优化,在本实施例中,将步骤“提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像”优化为:根据待处理图像的亮度统计数据计算伽马参数;根据伽马参数对待处理图像进行调整,以提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,得到样本图像;根据样本图像生成HDR图像。Fig. 2 is a schematic flowchart of a method for generating a high dynamic range image provided by Embodiment 2 of the present invention. This embodiment is optimized on the basis of the above embodiment. In this embodiment, the step "improve the brightness in the image to be processed The brightness of the area whose value is lower than the second brightness threshold, and generate an HDR image" is optimized as follows: calculate the gamma parameter according to the brightness statistics of the image to be processed; adjust the image to be processed according to the gamma parameter to improve the brightness in the image to be processed The brightness of the area whose value is lower than the second brightness threshold is obtained to obtain a sample image; an HDR image is generated according to the sample image.
相应的,本实施例的方法包括如下步骤:Correspondingly, the method of this embodiment includes the following steps:
步骤201、计算当前缓存图像的亮度加权平均值。Step 201. Calculate the brightness weighted average value of the current cached image.
其中,亮度值高于第一亮度阈值的区域的权重高于其他区域的权重。Wherein, weights of regions whose luminance values are higher than the first luminance threshold are higher than weights of other regions.
步骤202、根据由亮度加权平均值确定的曝光参数来控制摄像头捕捉图像,作为待处理图像。Step 202: Control the camera to capture an image according to the exposure parameter determined by the brightness weighted average value as the image to be processed.
步骤203、根据待处理图像的亮度统计数据计算伽马参数。Step 203, calculating a gamma parameter according to the luminance statistical data of the image to be processed.
示例性的,待处理图像的亮度统计数据可包括:待处理图像的子区域亮度平均值和待处理图像的亮度直方图。例如,可将待处理图像平均分成N个子区域,子区域i(1≤i≤N)的亮度平均值为子区域i中包含的所有像素的亮度的平均值。亮度直方图,又称色阶,是以亮度值为横坐标、以像素数量为纵坐标的图像,亮度直方图用图形表示了图像的每个亮度级别的像素的数量,展现了像素在图像中的分布情况。Exemplarily, the brightness statistical data of the image to be processed may include: a sub-region brightness average of the image to be processed and a brightness histogram of the image to be processed. For example, the image to be processed may be equally divided into N subregions, and the average brightness of subregion i (1≤i≤N) is the average brightness of all pixels contained in subregion i. The brightness histogram, also known as the color scale, is an image with the brightness value as the abscissa and the number of pixels as the ordinate. The brightness histogram graphically represents the number of pixels at each brightness level of the image, and shows the pixels in the image. of the distribution.
示例性的,Gamma参数可包括Gamma曲线或Gamma值。Gamma曲线是一种特殊的色调曲线,当Gamma值等于1的时候,曲线为与坐标轴成45°的直线,这个时候表示输入和输出密度相同。高于1的Gamma值将会造成输出暗化,低于1的Gamma值将会造成输出亮化。在现有方案中,Gamma参数通常为预先设置好的固定值,或根据不同的拍照模式直接选取相应的Gamma参数;而在本实施例中,根据待处理图像的亮度统计数据重新计算Gamma参数,以便于后续对待处理图像进行调整。Exemplarily, the Gamma parameter may include a Gamma curve or a Gamma value. The Gamma curve is a special tone curve. When the Gamma value is equal to 1, the curve is a straight line at 45° to the coordinate axis, which means that the input and output densities are the same. Gamma values above 1 will darken the output, and Gamma values below 1 will lighten the output. In existing solutions, the Gamma parameter is usually a preset fixed value, or the corresponding Gamma parameter is directly selected according to different camera modes; in this embodiment, the Gamma parameter is recalculated according to the brightness statistics of the image to be processed, In order to facilitate subsequent adjustments to the image to be processed.
步骤204、根据伽马参数对待处理图像进行调整,以提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,得到样本图像。Step 204 , adjust the image to be processed according to the gamma parameter, so as to increase the brightness of the region whose brightness value is lower than the second brightness threshold in the image to be processed, and obtain a sample image.
示例性的,根据步骤203中计算出来的Gamma参数对待处理图像进行调整后,可提升待处理图像中暗处区域的亮度。Exemplarily, after adjusting the image to be processed according to the Gamma parameter calculated in step 203, the brightness of the dark region in the image to be processed may be increased.
步骤205、根据样本图像生成HDR图像。Step 205, generate an HDR image according to the sample image.
本发明实施例二提供的高动态范围图像的生成方法,根据待处理图像的亮度统计数据计算Gamma参数,并根据Gamma参数对待处理图像进行调整,以提升待处理图像中暗处区域的亮度,最终生成HDR图像,能够进一步提升HDR图像的图像质量,展现更多的图像细节,满足用户需求。此外,基于亮度统计数据来对待处理图像进行调整,对处理器的消耗很少,从而可降低处理器的使用率,进一步优化用户体验。In the method for generating a high dynamic range image provided by Embodiment 2 of the present invention, the Gamma parameter is calculated according to the brightness statistical data of the image to be processed, and the image to be processed is adjusted according to the Gamma parameter to increase the brightness of the dark area in the image to be processed, and finally Generating HDR images can further improve the image quality of HDR images, show more image details, and meet user needs. In addition, adjusting the image to be processed based on the luminance statistical data consumes little processor, thereby reducing processor usage and further optimizing user experience.
在上述实施例的基础上,步骤“根据样本图像生成HDR图像”可进一步优化为:对样本图像进行降噪处理,并生成HDR图像。这样做的好处在于,根据Gamma参数对待处理图像进行调整时,可能会引入噪声,为了进一步提升照片质量,可对样本图像先进行降噪处理,再生成HDR图像。On the basis of the above embodiments, the step of "generating an HDR image according to the sample image" may be further optimized as: performing noise reduction processing on the sample image, and generating an HDR image. The advantage of this is that when the image to be processed is adjusted according to the Gamma parameter, noise may be introduced. In order to further improve the quality of the photo, the sample image can be denoised before generating an HDR image.
进一步的,可利用小波降噪算法和/或多帧降噪算法对样本图像进行降噪处理,并生成HDR图像。所述利用多帧降噪算法对样本图像进行降噪处理,具体可包括:获取当前样本图像之前或之后的多张其他样本图像,对当前样本图像和所述多张其他样本图像进行合成降噪处理。Further, a wavelet denoising algorithm and/or a multi-frame denoising algorithm may be used to perform denoising processing on the sample image and generate an HDR image. The denoising processing of the sample image by using a multi-frame denoising algorithm may specifically include: acquiring multiple other sample images before or after the current sample image, and performing synthetic denoising on the current sample image and the multiple other sample images deal with.
优选的,可对多张样本图像分别利用小波降噪算法进行降噪处理后,再利用多帧降噪算法进行降噪处理,最终生成HDR图像,可进一步提升降噪效果。Preferably, multiple sample images may be denoised using a wavelet denoising algorithm, and then denoised using a multi-frame denoising algorithm to finally generate an HDR image, which may further improve the denoising effect.
实施例三Embodiment Three
图3为本发明实施例三提供的一种优选的高动态范围图像的生成方法的流程示意图,该方法尤其适用于0秒延迟(Zero Second Delay,ZSD;又称Zero Second Later,ZSL)拍照模式。如图3所示,该方法包括如下步骤:Fig. 3 is a schematic flow chart of a preferred high dynamic range image generation method provided by Embodiment 3 of the present invention, which is especially suitable for the 0-second delay (Zero Second Delay, ZSD; also known as Zero Second Later, ZSL) photographing mode . As shown in Figure 3, the method includes the following steps:
步骤301、计算当前缓存图像的亮度加权平均值。Step 301. Calculate the weighted average value of brightness of the current cached image.
其中,亮度值高于第一亮度阈值的区域的权重高于其他区域的权重。Wherein, weights of regions whose luminance values are higher than the first luminance threshold are higher than weights of other regions.
示例性的,ZSD拍照模式可理解为所拍即所得,用户按下拍照键那一刻拍到的照片就是用户在预览界面中所看到的照片,它是相对于普通模式拍照来讲的。在普通模式下拍照,按下拍照键后需要进行一系列地处理和校正,如对焦、调整曝光、调整白平衡等操作,然后再进行编码生成照片。例如,在预览30每秒传输帧(Frames Per Second,fps)的情况下,用户按下拍照键时是在第1帧,而实际上拍下的照片可能是第8帧的图像。而在ZSD模式下,会缓存若干帧图像,在用户按下拍照键那一刻,直接提取缓存帧进行编码并生成照片。例如,在预览30fps的情况下,用户按下拍照键时是在第1帧,则实际上拍得的照片也是第1帧的图像。Exemplarily, the ZSD camera mode can be understood as what you take is what you get. The photo taken at the moment the user presses the camera button is the photo the user sees in the preview interface, which is relative to the normal mode of taking pictures. To take a picture in normal mode, after pressing the camera button, a series of processing and corrections are required, such as focusing, adjusting exposure, adjusting white balance, etc., and then encoding to generate a photo. For example, in the case of previewing 30 frames per second (Frames Per Second, fps), when the user presses the camera key, it is in the first frame, but the actually captured photo may be the image in the eighth frame. In the ZSD mode, several frames of images are cached, and the moment the user presses the camera button, the cached frames are directly extracted for encoding and a photo is generated. For example, in the case of previewing at 30fps, when the user presses the camera button, it is in the first frame, and the actually captured photo is also the image in the first frame.
示例性的,本步骤可由自动曝光参数控制(Automatic Exposure Control,AEC)算法来完成,具体可采用全局测光方式获取测光数据,并根据测光数据计算得出所述亮度加权平均值。Exemplarily, this step can be completed by an automatic exposure parameter control (Automatic Exposure Control, AEC) algorithm, specifically, global photometry can be used to obtain photometry data, and the brightness weighted average can be calculated according to the photometry data.
步骤302、根据由亮度加权平均值确定的曝光参数来控制摄像头捕捉图像,作为待处理图像。Step 302: Control the camera to capture an image according to the exposure parameter determined by the brightness weighted average value as the image to be processed.
步骤303、根据待处理图像的亮度统计数据计算伽马参数。Step 303, calculating a gamma parameter according to the luminance statistical data of the image to be processed.
示例性的,可由Gamma调整算法根据待处理图像的子区域亮度平均值和亮度直方图来计算用于提升待处理图像中暗处区域亮度的Gamma参数。Exemplarily, the Gamma parameter used to increase the brightness of the dark area in the image to be processed may be calculated by a Gamma adjustment algorithm according to the average brightness of sub-regions and the brightness histogram of the image to be processed.
步骤304、根据伽马参数对待处理图像进行调整,以提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,得到样本图像。Step 304 , adjust the image to be processed according to the gamma parameter, so as to increase the brightness of the area in the image to be processed whose brightness value is lower than the second brightness threshold, and obtain a sample image.
步骤305、控制预览界面实时显示样本图像。Step 305, controlling the preview interface to display the sample image in real time.
示例性的,可将计算得到的Gamma参数写入图像信号处理器(Image SignalProcessor,ISP),并由ISP控制预览界面实时显示样本图像,使用户能够在预览界面看到具有HDR效果的图像,方便用户捕捉自己喜欢的画面。Exemplarily, the calculated Gamma parameters can be written into an Image Signal Processor (Image Signal Processor, ISP), and the ISP controls the preview interface to display the sample image in real time, so that the user can see the image with the HDR effect on the preview interface, which is convenient Users capture their favorite pictures.
步骤306、判断是否接收到拍照指令,若是,则执行步骤307;否则,继续执行步骤306。Step 306 , judging whether a photographing instruction is received, if yes, execute step 307 ; otherwise, continue to execute step 306 .
示例性的,当用户按下拍照键(或快门键)时,可接收到拍照指令。Exemplarily, when the user presses the camera button (or shutter button), a camera instruction may be received.
步骤307、获取预览界面显示的当前样本图像。Step 307, acquiring the current sample image displayed on the preview interface.
步骤308、对当前样本图像进行降噪处理,并生成HDR图像。Step 308, perform noise reduction processing on the current sample image, and generate an HDR image.
进一步的,可利用小波降噪算法和/或多帧降噪算法对样本图像进行降噪处理,并生成HDR图像。Further, a wavelet denoising algorithm and/or a multi-frame denoising algorithm may be used to perform denoising processing on the sample image and generate an HDR image.
本发明实施例三提供的高动态范围图像的生成方法,能够在预览界面实时显示具备HDR效果的样本图像,可适用于ZSD拍照模式,当用户在预览界面看到自己满意的样本图像时,按下拍照键,移动终端就会获取当前样本图像,并对当前样本图像进行降噪处理,生成HDR图像。该方法与ZSD拍照模式相结合,让用户轻松实现通过观察预览界面来拍摄HDR照片,可进一步提升用户拍摄体验。The high dynamic range image generation method provided by Embodiment 3 of the present invention can display sample images with HDR effects in real time on the preview interface, and is applicable to the ZSD camera mode. When the user sees the sample image he is satisfied with in the preview interface, press Press the camera button, the mobile terminal will acquire the current sample image, and perform noise reduction processing on the current sample image to generate an HDR image. This method is combined with the ZSD camera mode, allowing users to easily take HDR photos by observing the preview interface, which can further enhance the user's shooting experience.
实施例四Embodiment Four
图4为本发明实施例四提供的一种高动态范围图像的生成装置的结构框图,该装置可由软件和/或硬件实现,一般集成在移动设备中,可通过执行高动态范围图像的生成方法来实现拍摄HDR照片。如图4所示,该装置包括:亮度加权平均值计算模块401、图像捕捉控制模块402和HDR图像生成模块403。Fig. 4 is a structural block diagram of an apparatus for generating a high dynamic range image provided in Embodiment 4 of the present invention. The apparatus can be realized by software and/or hardware, and is generally integrated in a mobile device, and can be implemented by executing a method for generating a high dynamic range image To achieve HDR photos. As shown in FIG. 4 , the device includes: a brightness weighted average calculation module 401 , an image capture control module 402 and an HDR image generation module 403 .
其中,亮度加权平均值计算模块401,用于计算当前缓存图像的亮度加权平均值,其中,亮度值高于第一亮度阈值的区域的权重高于其他区域的权重;图像捕捉控制模块402,用于根据由所述亮度加权平均值确定的曝光参数来控制摄像头捕捉图像,作为待处理图像;HDR图像生成模块403,用于提升所述待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像。Wherein, the brightness weighted average calculation module 401 is used to calculate the brightness weighted average value of the current cached image, wherein the weight of the region whose brightness value is higher than the first brightness threshold is higher than the weight of other regions; the image capture control module 402 uses Based on controlling the camera to capture an image according to the exposure parameters determined by the weighted average value of the brightness, as the image to be processed; the HDR image generation module 403 is used to increase the brightness of the area in the image to be processed whose brightness value is lower than the second brightness threshold Brightness, and generate HDR images.
本发明实施例四提供的高动态范围图像的生成装置,由亮度加权平均值计算模块401计算当前缓存图像的亮度加权平均值,并提升了亮度值高于第一亮度阈值的区域的权重,相比与现有方案中计算亮度平均值来说,所计算出来的图像整体亮度值更高,图像捕捉控制模块402依此确定的曝光参数可保证在控制摄像头捕捉图像时,亮区不会出现曝光过度的情况,将以上述曝光参数捕捉的图像作为待处理图像,由HDR图像生成模块403提升待处理图像中亮度值低于第二亮度阈值的区域的亮度,并生成HDR图像,可有效提高HDR图像的动态范围,且该方法不需要拍摄多张照片来合成HDR图像,可提升处理速度,实现快速拍照。In the device for generating a high dynamic range image provided in Embodiment 4 of the present invention, the brightness weighted average value calculation module 401 calculates the brightness weighted average value of the current cached image, and increases the weight of the region whose brightness value is higher than the first brightness threshold value. Compared with the calculation of the average brightness value in the existing solution, the calculated overall brightness value of the image is higher, and the exposure parameters determined by the image capture control module 402 can ensure that when the camera is controlled to capture the image, the bright area will not be exposed In an excessive situation, the image captured with the above exposure parameters is used as the image to be processed, and the HDR image generation module 403 increases the brightness of the region whose brightness value is lower than the second brightness threshold in the image to be processed, and generates an HDR image, which can effectively improve the HDR. The dynamic range of the image, and this method does not need to take multiple photos to synthesize the HDR image, which can improve the processing speed and realize fast photo taking.
在上述实施例的基础上,所述HDR图像生成模块包括伽马参数计算单元、待处理图像调整单元和HDR图像生成单元。其中,伽马参数计算单元,用于根据所述待处理图像的亮度统计数据计算伽马参数;待处理图像调整单元,用于根据所述伽马参数对所述待处理图像进行调整,以提升所述待处理图像中亮度值低于第二亮度阈值的区域的亮度,得到样本图像;HDR图像生成单元,用于根据所述样本图像生成HDR图像。On the basis of the above embodiments, the HDR image generation module includes a gamma parameter calculation unit, an image adjustment unit to be processed, and an HDR image generation unit. Wherein, the gamma parameter calculation unit is used to calculate the gamma parameter according to the brightness statistical data of the image to be processed; the image to be processed adjustment unit is used to adjust the image to be processed according to the gamma parameter to improve A sample image is obtained from the brightness of an area whose brightness value is lower than a second brightness threshold in the image to be processed; an HDR image generating unit is configured to generate an HDR image according to the sample image.
在上述实施例的基础上,所述HDR图像生成单元具体用于:对所述样本图像进行降噪处理,并生成HDR图像。On the basis of the above embodiments, the HDR image generating unit is specifically configured to: perform noise reduction processing on the sample image, and generate an HDR image.
在上述实施例的基础上,所述HDR图像生成单元具体用于:利用小波降噪算法和/或多帧降噪算法对所述样本图像进行降噪处理,并生成HDR图像。On the basis of the above embodiments, the HDR image generation unit is specifically configured to: perform noise reduction processing on the sample image by using a wavelet noise reduction algorithm and/or a multi-frame noise reduction algorithm, and generate an HDR image.
在上述实施例的基础上,所述HDR图像生成单元包括预览界面控制子单元、当前样本图像获取子单元和HDR图像生成子单元。其中,预览界面控制子单元,用于控制预览界面实时显示样本图像;当前样本图像获取子单元,用于在接收到拍照指令时,获取所述预览界面显示的当前样本图像;HDR图像生成子单元,用于根据所述当前样本图像生成HDR图像。On the basis of the above embodiments, the HDR image generation unit includes a preview interface control subunit, a current sample image acquisition subunit, and an HDR image generation subunit. Wherein, the preview interface control subunit is used to control the preview interface to display sample images in real time; the current sample image acquisition subunit is used to obtain the current sample image displayed on the preview interface when receiving a photographing instruction; the HDR image generation subunit , for generating an HDR image according to the current sample image.
在上述实施例的基础上,所述待处理图像的亮度统计数据包括:所述待处理图像的子区域亮度平均值和所述待处理图像的亮度直方图。On the basis of the above embodiments, the brightness statistical data of the image to be processed includes: a sub-region brightness average value of the image to be processed and a brightness histogram of the image to be processed.
实施例五Embodiment five
本发明实施例五提供了一种移动终端,该移动终端集成了本发明实施例中的高动态范围图像的生成装置,可通过执行高动态范围图像的生成方法来实现拍摄HDR照片。Embodiment 5 of the present invention provides a mobile terminal, which integrates the device for generating a high dynamic range image in the embodiment of the present invention, and can realize taking HDR photos by executing a method for generating a high dynamic range image.
示例性的,本实施例中的移动终端具体可为手机、平板电脑以及数码照相机等终端,优选为智能手机。Exemplarily, the mobile terminal in this embodiment may specifically be a terminal such as a mobile phone, a tablet computer, and a digital camera, preferably a smart phone.
当用户使用本实施例中的移动终端拍摄HDR照片时,所拍摄的HDR照片具备较高的动态范围,且拍照速度快,可提升用户拍摄体验。When the user uses the mobile terminal in this embodiment to take an HDR photo, the HDR photo taken has a higher dynamic range, and the shooting speed is fast, which can improve the user's shooting experience.
上述实施例中提供的高动态范围图像的生成装置及移动终端可执行本发明任意实施例所提供的高动态范围图像的生成方法,具备执行该方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本发明任意实施例所提供的高动态范围图像的生成方法。The device for generating a high dynamic range image and the mobile terminal provided in the above embodiments can execute the method for generating a high dynamic range image provided in any embodiment of the present invention, and have corresponding functional modules and beneficial effects for executing the method. For technical details not exhaustively described in the foregoing embodiments, reference may be made to the method for generating a high dynamic range image provided in any embodiment of the present invention.
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510973323.3A CN105578068B (en) | 2015-12-21 | 2015-12-21 | A kind of generation method of high dynamic range images, device and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510973323.3A CN105578068B (en) | 2015-12-21 | 2015-12-21 | A kind of generation method of high dynamic range images, device and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105578068A CN105578068A (en) | 2016-05-11 |
CN105578068B true CN105578068B (en) | 2018-09-04 |
Family
ID=55887674
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510973323.3A Expired - Fee Related CN105578068B (en) | 2015-12-21 | 2015-12-21 | A kind of generation method of high dynamic range images, device and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105578068B (en) |
Families Citing this family (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018119590A1 (en) * | 2016-12-26 | 2018-07-05 | 深圳市道通智能航空技术有限公司 | Light-measuring method and device, exposure method and device, and unmanned aerial vehicle |
KR20180097966A (en) * | 2017-02-24 | 2018-09-03 | 삼성전자주식회사 | Image processing method for autonomous driving and apparatus thereof |
CN108694030B (en) * | 2017-04-11 | 2020-07-28 | 华为技术有限公司 | Method and apparatus for processing high dynamic range images |
CN109035181B (en) * | 2017-06-08 | 2022-02-08 | 小元感知(北京)科技有限公司 | Wide dynamic range image processing method based on image average brightness |
CN107370963B (en) * | 2017-08-28 | 2023-08-08 | 北京地平线信息技术有限公司 | Image processing method, image processing device and electronic equipment |
CN107613218A (en) * | 2017-09-15 | 2018-01-19 | 维沃移动通信有限公司 | A high dynamic range image shooting method and mobile terminal |
CN107809582A (en) * | 2017-10-12 | 2018-03-16 | 广东欧珀移动通信有限公司 | Image processing method, electronic device and computer readable storage medium |
CN108307109B (en) * | 2018-01-16 | 2020-04-17 | 维沃移动通信有限公司 | High dynamic range image preview method and terminal equipment |
CN111418201B (en) * | 2018-03-27 | 2021-10-15 | 华为技术有限公司 | Shooting method and equipment |
CN111050143B (en) * | 2018-10-11 | 2021-09-21 | 华为技术有限公司 | Image shooting method and terminal equipment |
CN110198417A (en) * | 2019-06-28 | 2019-09-03 | Oppo广东移动通信有限公司 | Image processing method, image processing device, storage medium and electronic equipment |
CN110443766B (en) * | 2019-08-06 | 2022-05-31 | 厦门美图之家科技有限公司 | Image processing method and device, electronic equipment and readable storage medium |
CN110519485B (en) * | 2019-09-09 | 2021-08-31 | Oppo广东移动通信有限公司 | Image processing method, device, storage medium and electronic device |
JP2021124638A (en) * | 2020-02-06 | 2021-08-30 | キヤノン株式会社 | Display control device, display control method, program and storage medium |
CN111654638B (en) * | 2020-04-30 | 2021-09-07 | 深圳英飞拓智能技术有限公司 | Method and device for adjusting wide dynamic imaging exposure of camera |
CN115134508A (en) * | 2021-03-27 | 2022-09-30 | 影石创新科技股份有限公司 | Image processing method, imaging device, image processing device, and readable storage medium |
CN113920022B (en) * | 2021-09-29 | 2024-12-17 | 深圳市景阳科技股份有限公司 | Image optimization method and device, terminal equipment and readable storage medium |
EP4408010A1 (en) * | 2023-01-27 | 2024-07-31 | Aptiv Technologies AG | Method and apparatus for controlling the exposure time of an imaging device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1953515A (en) * | 2006-11-21 | 2007-04-25 | 北京中星微电子有限公司 | A method to automatically regulate the image brightness and automatic imaging device |
CN101064783A (en) * | 2006-04-30 | 2007-10-31 | 华为技术有限公司 | Method for obtaining automatic exposure control parameter and control method and image forming apparatus |
CN101873435A (en) * | 2009-04-23 | 2010-10-27 | 微星科技股份有限公司 | Method and device for generating high dynamic range images |
JP2014060578A (en) * | 2012-09-18 | 2014-04-03 | Olympus Imaging Corp | Image pick-up device |
-
2015
- 2015-12-21 CN CN201510973323.3A patent/CN105578068B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101064783A (en) * | 2006-04-30 | 2007-10-31 | 华为技术有限公司 | Method for obtaining automatic exposure control parameter and control method and image forming apparatus |
CN1953515A (en) * | 2006-11-21 | 2007-04-25 | 北京中星微电子有限公司 | A method to automatically regulate the image brightness and automatic imaging device |
CN101873435A (en) * | 2009-04-23 | 2010-10-27 | 微星科技股份有限公司 | Method and device for generating high dynamic range images |
JP2014060578A (en) * | 2012-09-18 | 2014-04-03 | Olympus Imaging Corp | Image pick-up device |
Also Published As
Publication number | Publication date |
---|---|
CN105578068A (en) | 2016-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105578068B (en) | A kind of generation method of high dynamic range images, device and mobile terminal | |
CN111418201B (en) | Shooting method and equipment | |
CN109218628B (en) | Image processing method, device, electronic device and storage medium | |
CN110033418B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
US9894287B2 (en) | Method and apparatus for acquiring a high dynamic image using multiple cameras | |
WO2020034737A1 (en) | Imaging control method, apparatus, electronic device, and computer-readable storage medium | |
CN108337445B (en) | Photographing method, related equipment and computer storage medium | |
US11431915B2 (en) | Image acquisition method, electronic device, and non-transitory computer readable storage medium | |
US9294687B2 (en) | Robust automatic exposure control using embedded data | |
CN112785537B (en) | Image processing method, device and storage medium | |
CN110198417A (en) | Image processing method, image processing device, storage medium and electronic equipment | |
CN110213502B (en) | Image processing method, device, storage medium and electronic device | |
JP2021500820A (en) | Imaging control method and imaging device | |
US20220094838A1 (en) | Method, Electronic Device and Computer-Readable Storage Medium for Generating a High Dynamic Range Image | |
CN104917973B (en) | dynamic exposure adjusting method and electronic device thereof | |
CN106127698A (en) | Image noise reduction treating method and apparatus | |
EP3306913B1 (en) | Photographing method and apparatus | |
KR20150099302A (en) | Electronic device and control method of the same | |
WO2020034701A1 (en) | Imaging control method and apparatus, electronic device, and readable storage medium | |
JP2012209951A (en) | Imaging apparatus, imaging method, integrated circuit, and program | |
WO2020034702A1 (en) | Control method, device, electronic equipment and computer readable storage medium | |
CN110445986B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
US20210168273A1 (en) | Control Method and Electronic Device | |
CN110047060B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
CN110266954A (en) | Image processing method, image processing device, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CP01 | Change in the name or title of a patent holder | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180904 |
|
CF01 | Termination of patent right due to non-payment of annual fee |