CN107888840B - High dynamic range image acquisition method and device - Google Patents
High dynamic range image acquisition method and device Download PDFInfo
- Publication number
- CN107888840B CN107888840B CN201711036202.1A CN201711036202A CN107888840B CN 107888840 B CN107888840 B CN 107888840B CN 201711036202 A CN201711036202 A CN 201711036202A CN 107888840 B CN107888840 B CN 107888840B
- Authority
- CN
- China
- Prior art keywords
- pixel ratio
- current scene
- brightness
- threshold value
- color channel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
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
Description
技术领域technical field
本申请涉及曝光处理技术领域,特别涉及一种高动态范围图像获取方法和装置。The present application relates to the technical field of exposure processing, and in particular, to a high dynamic range image acquisition method and device.
背景技术Background technique
目前,各种智能终端的功能越发多样化,用户可通过终端设备的相机进行拍照。特别是当拍摄环境处于逆光时,相机就会自动切换拍照模式为高动态范围图像(HighDynamic Range,简称为:HDR)模式进行拍照,以得到质量好的图像。At present, the functions of various smart terminals are more and more diversified, and users can take pictures through the camera of the terminal device. Especially when the shooting environment is in backlight, the camera will automatically switch the shooting mode to a high dynamic range image (High Dynamic Range, referred to as: HDR) mode to take a picture, so as to obtain a high-quality image.
在实际应用过程中,终端设备一般是基于颜色编码空间(YUV)对拍摄环境进行检测,以确定出当前拍摄环境是否为逆光环境。然而YUV数据是经过图像处理器(ImageSignal Processor,简称为:ISP)进行一系列的处理后获取的,这就会造成YUV中的数据并不能完全真实的反映当前的拍摄环境,从而导致对拍摄环境的检测出现误差,影响拍摄图像的质量。In a practical application process, the terminal device generally detects the shooting environment based on a color coding space (YUV) to determine whether the current shooting environment is a backlight environment. However, the YUV data is obtained after a series of processing by the Image Signal Processor (ISP), which will cause the data in the YUV to not fully reflect the current shooting environment, which will lead to the failure of the shooting environment. There is an error in the detection, which affects the quality of the captured image.
发明内容SUMMARY OF THE INVENTION
本申请旨在至少在一定程度上解决上述的技术缺陷之一。The present application aims to solve one of the above-mentioned technical defects at least to a certain extent.
为此,本申请的第一个目的在于提出一种高动态范围图像获取方法,该方法提高了对拍摄场景逆光检测的准确度,进而保证了拍摄画面的质量,提高了用户体验。Therefore, the first objective of the present application is to propose a high dynamic range image acquisition method, which improves the accuracy of backlight detection of the shooting scene, thereby ensuring the quality of the shooting picture and improving the user experience.
本申请的第二个目的在于提出一种高动态范围图像获取装置。The second object of the present application is to provide a high dynamic range image acquisition device.
本申请的第三个目的在于提出一种终端设备。The third objective of the present application is to provide a terminal device.
本申请的第四个目的在于提出一种计算机可读存储介质。A fourth object of the present application is to propose a computer-readable storage medium.
为了实现上述目的,本申请第一方面实施例的高动态范围图像获取方法,包括:从自动曝光控制系统中,获取与当前场景对应的亮度信息;根据所述当前场景对应的亮度信息,确定所述当前场景对应的像素比例阈值及亮度阈值;确定所述当前场景对应的各颜色通道直方图,其中各颜色通道直方图包括各颜色通道下的不同亮度与像素比例的对应关系;根据所述当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄;在确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取所述当前场景的高动态范围图像。In order to achieve the above purpose, the method for obtaining a high dynamic range image according to the embodiment of the first aspect of the present application includes: obtaining brightness information corresponding to the current scene from an automatic exposure control system; determining the brightness information corresponding to the current scene according to the brightness information corresponding to the current scene the pixel ratio threshold and the brightness threshold corresponding to the current scene; determine each color channel histogram corresponding to the current scene, wherein each color channel histogram includes the corresponding relationship between different brightness and pixel ratio under each color channel; according to the current scene The pixel ratio threshold, brightness threshold and each color channel histogram corresponding to the scene determine whether the current is backlit shooting; when it is determined that the current is backlit shooting, the high dynamic range image of the current scene is obtained by using the high dynamic range image shooting mode.
为了实现上述目的,本申请第二方面实施例的高动态范围图像获取装置,包括:第一获取模块,用于从自动曝光控制系统中,获取与当前场景对应的亮度信息;第一确定模块,用于根据所述当前场景对应的亮度信息,确定所述当前场景对应的像素比例阈值及亮度阈值;第二确定模块,用于确定所述当前场景对应的各颜色通道直方图,其中各颜色通道直方图包括各颜色通道下的不同亮度与像素比例的对应关系;第三确定模块,用于根据所述当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄;第二获取模块,用于在确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取所述当前场景的高动态范围图像。In order to achieve the above purpose, the high dynamic range image acquisition device according to the embodiment of the second aspect of the present application includes: a first acquisition module for acquiring brightness information corresponding to a current scene from an automatic exposure control system; a first determination module, is used to determine the pixel ratio threshold and the brightness threshold corresponding to the current scene according to the brightness information corresponding to the current scene; the second determination module is used to determine the histogram of each color channel corresponding to the current scene, wherein each color channel The histogram includes the corresponding relationship between different brightness and pixel ratio under each color channel; the third determination module is used for determining whether the current scene is a backlight shooting according to the pixel ratio threshold value, brightness threshold value and the histogram of each color channel corresponding to the current scene ; a second acquisition module, configured to acquire a high dynamic range image of the current scene by using a high dynamic range image shooting mode when it is determined that the current shooting is against the light.
为了实现上述目的,本申请第三方面实施例的终端设备,包括:存储器、处理器及摄像模组;所述摄像模组,用于采集当前场景下的图像;所述存储器,用于存储可执行程序代码;所述处理器,用于读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于实现第一方面实施例所述的高动态范围图像获取方法。In order to achieve the above purpose, the terminal device according to the embodiment of the third aspect of the present application includes: a memory, a processor, and a camera module; the camera module is used to collect images in the current scene; the memory is used to store available Execute program code; the processor is configured to read the executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the high dynamic performance described in the embodiment of the first aspect Range image acquisition method.
为了实现上述目的,本申请第四方面实施例的计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现第一方面实施例所述的高动态范围图像获取方法。To achieve the above purpose, the computer-readable storage medium of the fourth aspect of the present application stores a computer program thereon, and when the computer program is executed by the processor, implements the high dynamic range image acquisition method described in the first aspect.
本申请公开的技术方案,具有如下有益效果:The technical solution disclosed in the present application has the following beneficial effects:
通过从自动曝光控制系统中,获取与当前场景对应的亮度信息,并根据获取的当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值,并确定当前场景对应的各颜色通道直方图,然后根据当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄,若确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取当前场景的高动态范围图像。由此,提高了对拍摄场景逆光检测的准确度,进而保证了拍摄画面的质量,提高了用户体验。。By obtaining the brightness information corresponding to the current scene from the automatic exposure control system, and according to the obtained brightness information corresponding to the current scene, the pixel ratio threshold and brightness threshold corresponding to the current scene are determined, and the histogram of each color channel corresponding to the current scene is determined. Then, according to the pixel ratio threshold, brightness threshold and the histogram of each color channel corresponding to the current scene, determine whether the current scene is backlit shooting. If it is determined that the current scene is backlit shooting, use the high dynamic range image shooting mode to obtain the high dynamic range of the current scene. image. As a result, the accuracy of the backlight detection of the shooting scene is improved, thereby ensuring the quality of the shooting picture and improving the user experience. .
本申请附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the present application will be set forth, in part, in the following description, and in part will be apparent from the following description, or learned by practice of the present application.
附图说明Description of drawings
本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中,The above and/or additional aspects and advantages of the present application will become apparent and readily understood from the following description of embodiments taken in conjunction with the accompanying drawings, wherein,
图1是根据本申请一个实施例的高动态范围图像获取方法的流程图;1 is a flowchart of a method for acquiring a high dynamic range image according to an embodiment of the present application;
图2是根据本申请的一个实施例的对拍摄场景进行划分的示意图;2 is a schematic diagram of dividing a shooting scene according to an embodiment of the present application;
图3(a)是根据本申请一个实施例的红色通道直方图的示意图;3(a) is a schematic diagram of a red channel histogram according to an embodiment of the present application;
图3(b)是根据本申请一个实施例的绿色通道直方图的示意图;3(b) is a schematic diagram of a green channel histogram according to an embodiment of the present application;
图3(c)是根据本申请一个实施例的蓝色通道直方图的示意图;Figure 3(c) is a schematic diagram of a blue channel histogram according to an embodiment of the present application;
图4(a)—图4(c)是本申请一个实施例的各颜色通道在逆光场景下的通道直方图;Fig. 4 (a) - Fig. 4 (c) is the channel histogram of each color channel under the backlight scene of an embodiment of the present application;
图5是根据本申请另一个实施例的高动态范围图像获取方法的流程图;5 is a flowchart of a method for acquiring a high dynamic range image according to another embodiment of the present application;
图6是根据本申请一个实施例的高动态范围图像获取装置的结构示意图;6 is a schematic structural diagram of a device for acquiring a high dynamic range image according to an embodiment of the present application;
图7是根据本申请一个实施例的终端设备的结构示意图。FIG. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本申请,而不能理解为对本申请的限制。The following describes in detail the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary, and are intended to be used to explain the present application, but should not be construed as a limitation to the present application.
为了解决相关技术中,终端设备基于YUV对当前拍摄场景检测时,由于YUV数据是经过图像处理器进行一系列处理后获取的,这就导致YUV数据并不能完全真实的反映当前的拍摄环境,从而导致拍摄环境的检测出现误差,影响拍摄图像的质量的问题,提出了一种高动态范围图像获取方法、In order to solve the problem in the related art, when the terminal device detects the current shooting scene based on YUV, since the YUV data is obtained after a series of processing by the image processor, the YUV data cannot completely reflect the current shooting environment, so In order to solve the problem of errors in the detection of the shooting environment and affect the quality of the captured images, a high dynamic range image acquisition method is proposed.
本申请提供的高动态范围图像获取方法,通过从自动曝光控制系统(AutoExposure Control,简称为:AEC)中,获取与当前场景对应的亮度信息,然后根据当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值,并确定当前场景对应的各颜色通道直方图,其中各颜色通道直方图包括各颜色通道下的不同亮度与像素比例的对应关系,然后根据当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄,当确定出当前为逆光拍摄时,利用高动态范围图像拍摄模式获取当前场景的高动态范围图像。由此,提高了对拍摄场景逆光检测的准确度,保证了拍摄画面的质量,提高了用户体验。The method for obtaining a high dynamic range image provided by the present application obtains brightness information corresponding to the current scene from an automatic exposure control system (AutoExposure Control, AEC for short), and then determines the corresponding brightness of the current scene according to the brightness information corresponding to the current scene. and determine the histogram of each color channel corresponding to the current scene, wherein the histogram of each color channel includes the corresponding relationship between different brightness and pixel ratio under each color channel, and then according to the pixel ratio threshold corresponding to the current scene , brightness threshold, and the histogram of each color channel to determine whether the current scene is backlit shooting. When it is determined that the current scene is backlit shooting, the high dynamic range image shooting mode is used to obtain a high dynamic range image of the current scene. As a result, the accuracy of the backlight detection of the shooting scene is improved, the quality of the shooting picture is ensured, and the user experience is improved.
下面参考附图描述本申请实施例的高动态范围图像曝光补偿值获取方法。The following describes a method for obtaining an exposure compensation value of a high dynamic range image according to an embodiment of the present application with reference to the accompanying drawings.
图1是根据本申请一个实施例的高动态范围图像获取方法的流程图。FIG. 1 is a flowchart of a method for acquiring a high dynamic range image according to an embodiment of the present application.
如图1所示,本申请的高动态范围图像获取方法可以包括以下步骤:As shown in FIG. 1, the high dynamic range image acquisition method of the present application may include the following steps:
步骤101,从自动曝光控制系统中,获取与当前场景对应的亮度信息。Step 101: Obtain brightness information corresponding to the current scene from an automatic exposure control system.
具体的,本申请实施例提供的高动态范围图像获取方法,可以由本申请提供的高动态范围图像获取装置执行,上述装置配置于终端设备中,以实现对拍摄场景的检测进行控制。Specifically, the high dynamic range image acquisition method provided by the embodiment of the present application may be executed by the high dynamic range image acquisition apparatus provided by the present application, and the above-mentioned apparatus is configured in a terminal device to control the detection of the shooting scene.
其中,本实施例中终端设备可以是任意具有拍照功能的硬件设备,比如智能手机、照相机、个人计算机(personal computer,简称为PC)等等,本发明对此不作具体限定。The terminal device in this embodiment may be any hardware device with a photographing function, such as a smart phone, a camera, a personal computer (PC for short), etc., which is not specifically limited in the present invention.
具体的,由于在实际应用中,利用终端设备对拍摄区域进行拍摄操作时,AEC可以根据拍摄场景的亮度,对拍摄画面进行自动曝光补偿处理。因此本实施例可直接从AEC中获取与当前场景对应的亮度信息。Specifically, in practical applications, when a terminal device is used to perform a shooting operation on a shooting area, the AEC can perform automatic exposure compensation processing on the shooting image according to the brightness of the shooting scene. Therefore, in this embodiment, the brightness information corresponding to the current scene can be directly obtained from the AEC.
其中,在本实施例中,获取的亮度信息可以由以下信息中的任意一个表示:luxindex,或者iso,或者gain值,本申请对此不作具体限定。Wherein, in this embodiment, the acquired brightness information may be represented by any one of the following information: luxindex, or iso, or gain value, which is not specifically limited in this application.
步骤102,根据当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值。Step 102: Determine a pixel ratio threshold and a brightness threshold corresponding to the current scene according to the brightness information corresponding to the current scene.
需要说明的,由于同一物体,在不同亮度的拍摄场景中时处于逆光状态时,具有的特征不同,因此为了使得确定的当前场景对应的像素比例阈值及亮度阈值更准确,本申请可以预先对拍摄场景进行一个大致划分,并且对划分的场景分别进行像素比例阈值及亮度阈值的设置。It should be noted that since the same object has different characteristics when it is in a backlight state in shooting scenes of different brightness, in order to make the determined pixel ratio threshold and brightness threshold corresponding to the current scene more accurate, the The scene is roughly divided, and the pixel ratio threshold and the brightness threshold are respectively set for the divided scene.
比如,可根据拍摄场景的亮度大小,将拍摄场景分为三个,分别为高亮度场景、中亮度场景及低亮度场景,场景划分结果具体参见图2所示。For example, according to the brightness of the shooting scene, the shooting scenes can be divided into three, namely, high-brightness scenes, medium-brightness scenes, and low-brightness scenes. The scene division results are shown in FIG. 2 for details.
其中,高亮度场景可以为室外等光线好的区域,中亮度场景可以为室内光线较好的区域,低亮度场景则可以为夜晚光线差的区域等等,本申请对此不作具体限定。The high-brightness scene may be an outdoor area with good light, the medium-brightness scene may be an indoor area with good light, and the low-brightness scene may be an area with poor light at night, etc., which are not specifically limited in this application.
在对不同场景进行划分之后,本实施例可进一步地对每个场景进行像素比例阈值及亮度阈值的设置。After the different scenes are divided, this embodiment may further set a pixel ratio threshold and a brightness threshold for each scene.
其中,上述每个场景的像素比例阈值及亮度阈值可根据实际使用需求进行适应性设置,本申请对此不作具体限定。Wherein, the pixel ratio threshold and brightness threshold of each scene can be adaptively set according to actual usage requirements, which are not specifically limited in this application.
进一步地,当对拍摄场景进行场景划分,并且对每个场景设置对应的像素比例阈值及亮度阈值之后,本实施例可将步骤101获取的当前场景对应的亮度信息,分别与划分的每个场景进行匹配,以确定出当前场景对应的像素比例阈值及亮度阈值。Further, after scene division is performed on the shooting scene, and the corresponding pixel ratio threshold and brightness threshold are set for each scene, the present embodiment may separate the brightness information corresponding to the current scene obtained in
具体实现时,可先根据每个场景预设的亮度阈值与亮度范围的对应关系,确定与当前场景对应的目标亮度范围;然后根据预设的亮度范围与像素比例阈值及亮度阈值的对应关系,确定与目标亮度范围对应的像素比例阈值及亮度阈值。In specific implementation, the target brightness range corresponding to the current scene can be determined according to the corresponding relationship between the preset brightness threshold and the brightness range of each scene; then, according to the preset brightness range and the pixel ratio threshold and brightness threshold corresponding relationship, Determine the pixel ratio threshold and the brightness threshold corresponding to the target brightness range.
也就是说,本实施例是先根据获取的当前场景亮度信息,在不同场景的亮度范围中进行匹配,并根据匹配成功的亮度范围确定出当前场景所对应的场景,然后根据对应的场景中获取预设的像素比例阈值及亮度阈值。That is to say, in this embodiment, first, according to the acquired brightness information of the current scene, matching is performed in the brightness range of different scenes, and the scene corresponding to the current scene is determined according to the successfully matched brightness range, and then the scene corresponding to the current scene is determined according to the brightness range of the corresponding scene. The preset pixel ratio threshold and brightness threshold.
举例说明,若获取的当前场景对应的亮度信息为3勒克斯(lux),而预先划分的三个场景分别为夜间、室内、室外,且上述三个场景对应的亮度范围分别为:0.001~0.3lux、100~1000lux、大于1000lux。那么可将亮度信息为3分别与上述三个场景对应的亮度范围0.001~0.3lux、100~1000lux、大于1000lux进行匹配,确定出当前场景的亮度信息属于100~1000lux的亮度范围。然后根据亮度范围为100~1000lux对应确定出当前场景属于室内,进而可获取室内对应的像素比例阈值及亮度阈值。For example, if the acquired brightness information corresponding to the current scene is 3 lux, and the three pre-divided scenes are night, indoor, and outdoor, respectively, and the corresponding brightness ranges of the above three scenes are: 0.001~0.3lux , 100~1000lux, more than 1000lux. Then, the brightness information of 3 can be matched with the brightness ranges of 0.001 to 0.3 lux, 100 to 1000 lux, and greater than 1000 lux corresponding to the above three scenes, and it is determined that the brightness information of the current scene belongs to the brightness range of 100 to 1000 lux. Then, according to the brightness range of 100-1000 lux, it is determined that the current scene belongs to the room, and then the pixel ratio threshold and brightness threshold corresponding to the room can be obtained.
步骤103,确定当前场景对应的各颜色通道直方图,其中各颜色通道直方图包括各颜色通道下的不同亮度与像素比例的对应关系。Step 103: Determine each color channel histogram corresponding to the current scene, wherein each color channel histogram includes the corresponding relationship between different luminances and pixel ratios under each color channel.
具体的,可以根据RGB数据,确定出当前场景对应的各颜色通道直方图,本实施例对此不作过多赘述。Specifically, the histogram of each color channel corresponding to the current scene may be determined according to the RGB data, which will not be repeated in this embodiment.
需要说明的是,若本实施例中获取的RGB数据中包括红(R)、绿(G)、蓝(B)三个颜色通道,那么对应确定的各颜色通道直方图则为三个,分别为红色通道直方图、绿色通道直方图以及蓝色通道直方图。It should be noted that if the RGB data obtained in this embodiment includes three color channels of red (R), green (G), and blue (B), then the corresponding determined histograms of each color channel are three, respectively is the histogram of the red channel, the histogram of the green channel, and the histogram of the blue channel.
进一步的,上述确定的三种颜色通道直方图,可具体可参见图3所示,图3(a)为红色通道直方图,图3(b)为绿色通道直方图,图3(c)为蓝色通道直方图。其中,各颜色通道直方图中,x轴表示图像亮度,y轴表示图像中各像素位于该亮度下的像素比例。Further, the above-determined histograms of the three color channels can be found in Fig. 3. Fig. 3(a) is the histogram of the red channel, Fig. 3(b) is the histogram of the green channel, and Fig. 3(c) is the histogram of the green channel. Blue channel histogram. Among them, in the histogram of each color channel, the x-axis represents the image brightness, and the y-axis represents the pixel ratio of each pixel in the image under the brightness.
若本实施例中获取的RGB数据包括R,Gr,Gb,B四个颜色通道时,那么对应确定的颜色通道直方图则为四个,分别为红色通道直方图、绿色(Gr)通道直方图、绿色(Gb)通道直方图以及蓝色通道直方图。If the RGB data obtained in this embodiment includes four color channels, R, Gr, Gb, and B, the corresponding determined color channel histograms are four, which are the red channel histogram and the green (Gr) channel histogram respectively. , green (Gb) channel histogram, and blue channel histogram.
步骤104,根据当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄。
需要说明的是,由于逆光场景时,各颜色通道的直方图,通常如图4(a)—图4(c)所示的形式,为“双峰”分布,即像素多数集中在最低亮度和最高亮度的位置。It should be noted that, due to the backlight scene, the histogram of each color channel, usually in the form shown in Figure 4(a) - Figure 4(c), is a "bimodal" distribution, that is, most of the pixels are concentrated in the lowest brightness and The position of the highest brightness.
其中,图4(a)为逆光场景下红色通道的直方图,图4(b)为逆光场景下绿色通道的直方图,图4(c)为逆光场景下蓝色通道的直方图。其中,各颜色通道直方图中,x轴表示图像亮度,y轴表示图像中各像素位于该亮度下的像素比例。Among them, Fig. 4(a) is the histogram of the red channel under the backlight scene, Fig. 4(b) is the histogram of the green channel under the backlight scene, and Fig. 4(c) is the histogram of the blue channel under the backlight scene. Among them, in the histogram of each color channel, the x-axis represents the image brightness, and the y-axis represents the pixel ratio of each pixel in the image under the brightness.
因此,本实施例中的像素比例阈值可以包括两个,分别为第一像素比例阈值和第二像素比例阈值。Therefore, the pixel ratio threshold in this embodiment may include two, which are the first pixel ratio threshold and the second pixel ratio threshold respectively.
对应的,亮度阈值也包括两个,分别为第一亮度阈值和第二亮度阈值。Correspondingly, the brightness threshold also includes two, which are a first brightness threshold and a second brightness threshold.
并且,上述像素比例阈值与亮度阈值是相互对应设置的,即第一像素比例阈值与第一亮度阈值相对应,第二像素比例阈值与第二亮度阈值相对应。In addition, the pixel ratio threshold and the brightness threshold are set corresponding to each other, that is, the first pixel ratio threshold corresponds to the first brightness threshold, and the second pixel ratio threshold corresponds to the second brightness threshold.
从而,在获取到当前场景的直方图后,即可根据当前场景的直方图,判断当前是否为逆光拍摄。具体的,上述步骤104,可以通过以下方式实现:Therefore, after the histogram of the current scene is obtained, it can be determined whether the current scene is shot against the light according to the histogram of the current scene. Specifically, the
分别按照亮度由低至高及由高至低的方向,依次统计各颜色通道直方图中像素比例值的和;According to the direction of brightness from low to high and from high to low, count the sum of the pixel ratio values in the histogram of each color channel in turn;
确定按照亮度由低至高像素比例值的和达到第一像素比例阈值时,各颜色通道分别对应的各第一亮度值;Determine each first brightness value corresponding to each color channel when the sum of the pixel ratio values from low to high reaches the first pixel ratio threshold according to the brightness;
确定按照亮度由高至低像素比例值的和达到第二像素比例阈值时,各颜色通道分别对应的各第二亮度值;Determine each second brightness value corresponding to each color channel when the sum of the pixel ratio values from high to low reaches the second pixel ratio threshold according to the brightness;
若任一颜色通道对应的第一亮度值小于第一亮度阈值,且第二亮度值大于第二亮度阈值,则确定当前为逆光拍摄。If the first brightness value corresponding to any color channel is less than the first brightness threshold, and the second brightness value is greater than the second brightness threshold, it is determined that the shooting is currently in backlight.
举例说明,若第一像素比例阈值为6%,对应的第一亮度阈值为10,第二像素比例阈值为10%,对应的第二亮度阈值为230,并且各颜色通道直方图分别为红色通道直方图、绿色通道直方图及蓝色通道直方图。For example, if the first pixel ratio threshold is 6%, the corresponding first brightness threshold is 10, the second pixel ratio threshold is 10%, the corresponding second brightness threshold is 230, and the histogram of each color channel is the red channel. Histogram, Green Channel Histogram, and Blue Channel Histogram.
通过对红色通道直方图、绿色通道直方图及蓝色通道直方图分析后可知,红色通道直方图中,亮度由0向255变化时,像素比例阈值到达6%时,对应的第一亮度RL=8;绿色通道直方图中,亮度由0向255变化时,像素比例阈值到达6%时,对应的第一亮度GL=11;蓝色通道直方图中,亮度由0向255变化时,像素比例阈值到达6%时,对应的第一亮度BL=15。After analyzing the histogram of the red channel, the histogram of the green channel and the histogram of the blue channel, we can see that in the histogram of the red channel, when the brightness changes from 0 to 255, when the pixel ratio threshold reaches 6%, the corresponding first brightness RL= 8; In the histogram of the green channel, when the brightness changes from 0 to 255, and the pixel ratio threshold reaches 6%, the corresponding first brightness GL=11; in the histogram of the blue channel, when the brightness changes from 0 to 255, the pixel ratio When the threshold value reaches 6%, the corresponding first brightness BL=15.
对应的,红色通道直方图中,亮度由255向0变化时,像素比例阈值到达10%时,对应的第一亮度RL=234;绿色通道直方图中,亮度由255向0变化时,像素比例阈值到达10%时,对应的第一亮度GL=221;蓝色通道直方图中,亮度由255向0变化时,像素比例阈值到达10%时,对应的第一亮度BL=205;Correspondingly, in the histogram of the red channel, when the brightness changes from 255 to 0, and the pixel ratio threshold reaches 10%, the corresponding first brightness RL=234; in the histogram of the green channel, when the brightness changes from 255 to 0, the pixel ratio When the threshold reaches 10%, the corresponding first brightness GL=221; in the blue channel histogram, when the brightness changes from 255 to 0, when the pixel ratio threshold reaches 10%, the corresponding first brightness BL=205;
因此可以看出,红色通道直方图的第一亮度值小于第一亮度阈值,第二亮度值大于第二亮度阈值,则确定当前为逆光拍摄。Therefore, it can be seen that if the first brightness value of the red channel histogram is less than the first brightness threshold, and the second brightness value is greater than the second brightness threshold, it is determined that the current shooting is against backlight.
步骤105,在确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取当前场景的高动态范围图像。
具体的,可根据当前场景对应的各颜色通道直方图,确定当前场景对应的曝光补偿值;基于曝光补偿值获取当前场景对应的正常曝光图像、欠曝光图像及过曝光图像;将正常曝光图像、欠曝光图像及过曝光图像进行融合处理,生成当前场景的高动态范围图像。Specifically, the exposure compensation value corresponding to the current scene can be determined according to the histogram of each color channel corresponding to the current scene; the normal exposure image, underexposure image and overexposure image corresponding to the current scene are obtained based on the exposure compensation value; The underexposed image and the overexposed image are fused to generate a high dynamic range image of the current scene.
具体实现时,可先根据各颜色通道直方图下不同亮度与像素比例的对应关系、正常曝光亮度阈值以及像素比例阈值,确定出当前场景的欠曝光程度及过曝光程度,然后基于欠曝光程度及过曝光程度查询预设的曝光补偿映射表,以确定当前场景的欠曝光补偿值和过曝光补偿值。In specific implementation, the underexposure degree and overexposure degree of the current scene can be determined according to the corresponding relationship between different brightness and pixel ratio under the histogram of each color channel, the normal exposure brightness threshold value and the pixel ratio threshold value, and then based on the degree of underexposure and the degree of overexposure. The overexposure level queries the preset exposure compensation mapping table to determine the underexposure compensation value and overexposure compensation value of the current scene.
进一步地,在确定出当前场景的欠曝光补偿值和过曝光补偿值之后,本实施例可根据上述欠曝光补偿值和过曝光补偿值分别获取当前场景的过曝光图像及欠曝光图像。然后将获取的正常曝光图像、欠曝光图像及过曝光图像进行图像融合,得到一张能够显示更多图像细节的高质量高动态范围图像。Further, after determining the underexposure compensation value and the overexposure compensation value of the current scene, the present embodiment can obtain the overexposure image and the underexposure image of the current scene respectively according to the underexposure compensation value and the overexposure compensation value. Then the acquired normal exposure image, underexposure image and overexposure image are image-fused to obtain a high-quality high dynamic range image that can display more image details.
可以理解的是,本申请高动态范围图像获取装置,通过获取当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值,并且确定当前场景对应的各颜色通道直方图,然后根据像素比例阈值、亮度阈值及各颜色通道直方图确定当前是否为逆光拍摄,进而保证了在当前为逆光拍摄时,通过启动高动态范围图像拍摄模式对当前拍摄区域进行欠曝光图像拍摄、过曝光图像拍摄及正常曝光图像拍摄,然后将上述三个图像进行图像融合得到一个高动态范围图像,从而能够更清晰的显示图像上的细节,更真实的反映当前场景的真实视觉效果,提高了图像的质量。It can be understood that the high dynamic range image acquisition device of the present application determines the pixel ratio threshold and brightness threshold corresponding to the current scene by acquiring the brightness information corresponding to the current scene, and determines the histogram of each color channel corresponding to the current scene, and then according to the pixel ratio threshold value and the brightness threshold value corresponding to the current scene are determined. The ratio threshold, brightness threshold and the histogram of each color channel determine whether the current shooting is backlit, thus ensuring that when the current shooting is against the backlight, the current shooting area can be shot under exposure and overexposure by starting the high dynamic range image shooting mode. And the normal exposure image is taken, and then the above three images are fused to obtain a high dynamic range image, so that the details on the image can be displayed more clearly, the real visual effect of the current scene can be more truly reflected, and the quality of the image can be improved.
本申请实施例的高动态范围图像获取方法中,通过从自动曝光控制系统中,获取与当前场景对应的亮度信息,并根据获取的当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值,并确定当前场景对应的各颜色通道直方图,然后根据当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄,若确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取当前场景的高动态范围图像。由此,提高了对拍摄场景逆光检测的准确度,进而保证了拍摄画面的质量,提高了用户体验。In the high dynamic range image acquisition method of the embodiment of the present application, the brightness information corresponding to the current scene is acquired from the automatic exposure control system, and the pixel ratio threshold corresponding to the current scene and the threshold value of the pixel ratio corresponding to the current scene are determined according to the acquired brightness information corresponding to the current scene. Brightness threshold, and determine the histogram of each color channel corresponding to the current scene, and then determine whether the current scene is backlit shooting according to the pixel ratio threshold, brightness threshold and each color channel histogram corresponding to the current scene. If it is determined that the current scene is backlit shooting, use The HDR image capture mode acquires a HDR image of the current scene. As a result, the accuracy of the backlight detection of the shooting scene is improved, thereby ensuring the quality of the shooting picture and improving the user experience.
通过上述分析可知,本申请根据当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值,及对应的各颜色通道直方图,然后根据确定的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄。在本申请的一种可能的实现场景中,若拍摄场景中包括人脸,那么为了保证拍摄的图像中人脸区域的效果,AEC会自动对图像进行合理曝光控制,从而保证拍摄的画面不会过暗,而此时背景可能会出现过曝光。因此,本申请实施例中,在检测拍摄场景是否逆光时,若当前拍摄场景中包括人脸,则可以基于上述原因,对检测阈值进行适当调整,从而使得对当前是否为逆光的检测更准确,从使得拍摄出来的图像质量更高。下面结合图5,对上述情况进行具体说明。It can be seen from the above analysis that the present application determines the pixel ratio threshold and brightness threshold corresponding to the current scene, and the corresponding color channel histograms according to the brightness information corresponding to the current scene, and then according to the determined pixel ratio threshold, brightness threshold and each color channel Histogram, to determine whether the current is backlit shooting. In a possible implementation scenario of the present application, if the shooting scene includes a human face, in order to ensure the effect of the human face area in the captured image, AEC will automatically perform reasonable exposure control on the image, so as to ensure that the captured image does not too dark, where the background may appear overexposed. Therefore, in the embodiment of the present application, when detecting whether the shooting scene is backlit, if the current shooting scene includes a human face, the detection threshold can be appropriately adjusted based on the above reasons, so that the detection of whether the current is backlit is more accurate. The resulting images are of higher quality. The above situation will be described in detail below with reference to FIG. 5 .
图5是本申请的另一个高动态范围图像获取方法的流程图。FIG. 5 is a flowchart of another high dynamic range image acquisition method of the present application.
如图5所示,本申请的高动态范围图像获取方法可以包括以下步骤:As shown in FIG. 5 , the high dynamic range image acquisition method of the present application may include the following steps:
步骤501,从自动曝光控制系统中,获取与当前场景对应的亮度信息。Step 501: Obtain brightness information corresponding to the current scene from an automatic exposure control system.
步骤502,根据当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值。Step 502: Determine a pixel ratio threshold and a brightness threshold corresponding to the current scene according to the brightness information corresponding to the current scene.
步骤503,对当前场景进行人脸检测。
具体实现时,可通过人脸识别技术(Face Recognition Technology)对当前场景的拍摄画面进行人脸检测操作。During specific implementation, a face detection operation can be performed on the shooting picture of the current scene through a face recognition technology (Face Recognition Technology).
其中,人脸识别技术中可包括多种人脸检测方式,比如,基于特征的人脸检测、模板匹配法的人脸检测、基于adaboost算法的人脸检测等等,本申请对此不作具体限定。Among them, the face recognition technology may include a variety of face detection methods, such as feature-based face detection, template matching method, face detection based on adaboost algorithm, etc., which are not specifically limited in this application. .
步骤504,若确定当前场景中包括人脸区域,则对像素比例阈值及亮度阈值进行调整。
需要说明的是,在确定当前场景中包括人脸区域时,人脸部分通过AEC控制合理曝光,因此使得拍摄画面中的暗部可能不会过暗,而其背景通常会过曝。这就很容易导致拍摄画面的整体亮度被提高。It should be noted that, when it is determined that the current scene includes a face area, the face part is reasonably exposed through AEC, so that the dark part in the shooting picture may not be too dark, while the background is usually overexposed. This can easily lead to an increase in the overall brightness of the captured image.
而在拍摄画面的整体亮度被提高之后,继续使用步骤402中确定的像素比例阈值及亮度阈值来判断当前是否为逆光拍摄时,那么就会存在判断不准确的问题。However, after the overall brightness of the photographed image is increased, if the pixel ratio threshold and the brightness threshold determined in step 402 are continued to be used to judge whether the photograph is currently being photographed against the backlight, there will be a problem of inaccurate judgment.
因此,为了避免上述问题的发生,本申请在确定出当前场景中存在人脸区域时,对步骤502中确定的像素比例阈值及亮度阈值进行适当调整,以使得对当前是否为逆光拍摄的检测精度更高。Therefore, in order to avoid the occurrence of the above problems, when it is determined that there is a face area in the current scene, the present application appropriately adjusts the pixel ratio threshold and the brightness threshold determined in
其中,由于拍摄的画面中像素是比较集中在亮度最低和最高的位置,因此本实施例中的像素比例阈值可以包括第一像素比例阈值和第二像素比例阈值。Wherein, since the pixels in the captured picture are relatively concentrated in the lowest and highest brightness positions, the pixel ratio threshold in this embodiment may include a first pixel ratio threshold and a second pixel ratio threshold.
对应的,亮度阈值也可以包括第一亮度阈值和第二亮度阈值。Correspondingly, the brightness threshold may also include a first brightness threshold and a second brightness threshold.
并且,上述像素比例阈值与亮度阈值是相互对应设置的,即第一像素比例阈值与第一亮度阈值相对应,第二像素比例阈值与第二亮度阈值相对应。In addition, the pixel ratio threshold and the brightness threshold are set corresponding to each other, that is, the first pixel ratio threshold corresponds to the first brightness threshold, and the second pixel ratio threshold corresponds to the second brightness threshold.
具体实现时,本申请对像素比例阈值及亮度阈值进行调整时可包括:During specific implementation, when adjusting the pixel ratio threshold and the brightness threshold, the present application may include:
减小第一像素比例阈值,或者增加第一亮度阈值;Decrease the first pixel ratio threshold, or increase the first brightness threshold;
增加第二像素比例阈值,或者增加第二亮度阈值。Increase the second pixel scale threshold, or increase the second brightness threshold.
需要说明的,本申请之所以减少第一像素比例阈值,或者增加第一亮度阈值,是因为当包含人脸区域的拍摄画面经过AEC的曝光补偿之后,拍摄画面中的亮度已经被提高,若此时仍然使用先前确定的第一像素比例阈值,来判断当前是否为逆光拍摄时,则可能出现原本较暗的像素点已经不暗,那么导致判断的存在误差。It should be noted that the reason why the first pixel ratio threshold is reduced or the first brightness threshold is increased in this application is because the brightness in the shooting image has been increased after the exposure compensation of the AEC including the face area. When still using the previously determined first pixel ratio threshold to determine whether the current shooting is against the light, it may occur that the originally dark pixels are no longer dark, resulting in an error in the judgment.
同样的,增加第一亮度阈值,也是为了防止拍摄画面经过AEC的曝光补偿之后,导致最终判断的拍摄是否为逆光存在误差。Similarly, the increase of the first brightness threshold is also to prevent errors in the final determination of whether the shooting is backlit after exposure compensation of the AEC.
类似的,当拍摄画面经过AEC的曝光补偿之后,拍摄画面整体的亮度被提高,则就会出现处于最亮位置的像素比例增多,因此需要增大第二像素比例阈值,或者,增大第二亮度阈值。Similarly, after the exposure compensation of the AEC, the overall brightness of the shooting image is increased, and the proportion of pixels in the brightest position will increase, so it is necessary to increase the second pixel ratio threshold, or increase the second pixel ratio threshold. Brightness threshold.
步骤505,确定当前场景对应的各颜色通道直方图,其中各颜色通道直方图包括各颜色通道下的不同亮度与像素比例的对应关系。Step 505: Determine each color channel histogram corresponding to the current scene, wherein each color channel histogram includes the corresponding relationship between different luminances and pixel ratios under each color channel.
步骤506,根据调整后的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄。
步骤507,在确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取当前场景的高动态范围图像。
本申请实施例的高动态范围图像获取方法中,通过在确定出当前场景对应的像素比例阈值及亮度阈值之后,对当前场景进行人脸检测,若检测出当前场景中存在人脸区域,则对像素比例阈值及亮度阈值进行调整,从而提高了对拍摄场景逆光检测的准确度,进而保证了拍摄画面的质量,提高了用户体验。In the high dynamic range image acquisition method of the embodiment of the present application, after determining the pixel ratio threshold and the brightness threshold corresponding to the current scene, face detection is performed on the current scene. If it is detected that there is a face area in the current scene, the The pixel ratio threshold and brightness threshold are adjusted, thereby improving the accuracy of backlight detection of the shooting scene, thereby ensuring the quality of the shooting picture and improving the user experience.
为了实现上述实施例,本发明还提出了一种高动态范围图像获取装置。In order to realize the above embodiments, the present invention also provides a high dynamic range image acquisition device.
图6是本发明一个实施例的高动态范围图像获取装置的结构示意图。FIG. 6 is a schematic structural diagram of an apparatus for acquiring a high dynamic range image according to an embodiment of the present invention.
如图6所示,本申请的高动态范围图像获取装置包括:第一获取模块11、第一确定模块12、第二确定模块13、第三确定模块14及第二获取模块15。As shown in FIG. 6 , the high dynamic range image acquisition device of the present application includes: a
其中,第一获取模块11用于从自动曝光控制系统中,获取与当前场景对应的亮度信息;Wherein, the
第一确定模块12用于根据所述当前场景对应的亮度信息,确定所述当前场景对应的像素比例阈值及亮度阈值;The first determining
第二确定模块13用于确定所述当前场景对应的各颜色通道直方图,其中各颜色通道直方图包括各颜色通道下的不同亮度与像素比例的对应关系;The
第三确定模块14用于根据所述当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄;The
第二获取模块15用于在确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取所述当前场景的高动态范围图像。The
进一步地,在本申请的另一个实施例中,所述像素比例阈值包括:互相对应的第一像素比例阈值、第一亮度阈值及第二像素比例阈值、第二亮度阈值;Further, in another embodiment of the present application, the pixel ratio threshold includes: a first pixel ratio threshold, a first brightness threshold, a second pixel ratio threshold, and a second brightness threshold corresponding to each other;
所述第三确定模块14,包括:The
统计单元,用于分别按照亮度由低至高及由高至低的方向,依次统计所述各颜色通道直方图中像素比例值的和;a statistical unit, configured to count the sum of the pixel ratio values in the histogram of each color channel in turn according to the direction of brightness from low to high and from high to low;
第一确定单元,用于确定按照亮度由低至高像素比例值的和达到第一像素比例阈值时,各颜色通道分别对应的各第一亮度值;a first determining unit, configured to determine each first brightness value corresponding to each color channel when the sum of the pixel ratio values from low to high brightness reaches the first pixel ratio threshold;
第二确定单元,用于确定按照亮度由高至低像素比例值的和达到第二像素比例阈值时,各颜色通道分别对应的各第二亮度值;a second determining unit, configured to determine each second brightness value corresponding to each color channel when the sum of the pixel ratio values from high to low brightness reaches the second pixel ratio threshold;
第三确定单元,用于若任一颜色通道对应的第一亮度值小于第一亮度阈值,且第二亮度值大于第二亮度阈值,则确定当前为逆光拍摄。The third determining unit is configured to determine that the current shooting is in backlight if the first brightness value corresponding to any color channel is less than the first brightness threshold and the second brightness value is greater than the second brightness threshold.
需要说明的是,前述对高动态范围图像获取方法实施例的解释说明也适用于该实施例的高动态范围图像获取装置,其实现原理类似,此处不再赘述。It should be noted that the foregoing explanations of the embodiment of the high dynamic range image acquisition method are also applicable to the high dynamic range image acquisition device of this embodiment, and the implementation principle thereof is similar, which will not be repeated here.
本实施例提供的高动态范围图像获取装置中,通过从自动曝光控制系统中,获取与当前场景对应的亮度信息,并根据获取的当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值,并确定当前场景对应的各颜色通道直方图,然后根据当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄,若确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取当前场景的高动态范围图像。由此,提高了对拍摄场景逆光检测的准确度,进而保证了拍摄画面的质量,提高了用户体验。In the high dynamic range image acquisition device provided in this embodiment, the brightness information corresponding to the current scene is acquired from the automatic exposure control system, and according to the acquired brightness information corresponding to the current scene, the pixel ratio threshold and the corresponding pixel ratio of the current scene are determined. Brightness threshold, and determine the histogram of each color channel corresponding to the current scene, and then determine whether the current scene is backlit shooting according to the pixel ratio threshold, brightness threshold and each color channel histogram corresponding to the current scene. If it is determined that the current scene is backlit shooting, use The HDR image capture mode acquires a HDR image of the current scene. As a result, the accuracy of the backlight detection of the shooting scene is improved, thereby ensuring the quality of the shooting picture and improving the user experience.
为了实现上述实施例,本发明还提出一种终端设备。In order to realize the above embodiments, the present invention also provides a terminal device.
图7是本发明一个实施例的终端设备的结构示意图。FIG. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
参见图7,本申请终端设备包括存储器21、处理器22及摄像模组23;Referring to FIG. 7 , the terminal device of the present application includes a
所述摄像模组23用于采集当前场景下的图像;The
所述存储器21用于存储可执行程序代码;The
所述处理器22用于读取所述存储器21中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于实现第一方面实施例所述的高动态范围图像获取方法。其中高动态范围图像获取方法包括:从自动曝光控制系统中,获取与当前场景对应的亮度信息;根据所述当前场景对应的亮度信息,确定所述当前场景对应的像素比例阈值及亮度阈值;确定所述当前场景对应的各颜色通道直方图,其中各颜色通道直方图包括各颜色通道下的不同亮度与像素比例的对应关系;根据所述当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄;在确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取所述当前场景的高动态范围图像。The
其中,本实施例中终端设备可以是任意具有拍照功能的硬件设备,比如智能手机、照相机、个人计算机(personal computer,简称为PC)等等,本发明对此不作具体限定。The terminal device in this embodiment may be any hardware device with a photographing function, such as a smart phone, a camera, a personal computer (PC for short), etc., which is not specifically limited in the present invention.
需要说明的是,前述对高动态范围图像获取方法实施例的解释说明也适用于该实施例的终端设备,其实现原理类似,此处不再赘述。It should be noted that, the foregoing explanation of the embodiment of the method for acquiring a high dynamic range image is also applicable to the terminal device of this embodiment, and the implementation principle thereof is similar, which will not be repeated here.
本实施例提供的终端设备中,通过从自动曝光控制系统中,获取与当前场景对应的亮度信息,并根据获取的当前场景对应的亮度信息,确定当前场景对应的像素比例阈值及亮度阈值,并确定当前场景对应的各颜色通道直方图,然后根据当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄,若确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取当前场景的高动态范围图像。由此,提高了对拍摄场景逆光检测的准确度,进而保证了拍摄画面的质量,提高了用户体验。In the terminal device provided in this embodiment, the brightness information corresponding to the current scene is obtained from the automatic exposure control system, and the pixel ratio threshold and the brightness threshold corresponding to the current scene are determined according to the obtained brightness information corresponding to the current scene, and Determine the histogram of each color channel corresponding to the current scene, and then determine whether the current scene is backlit shooting according to the pixel ratio threshold, brightness threshold, and color channel histogram corresponding to the current scene. If it is determined that the current scene is backlit shooting, use the high dynamic range image Capture mode to acquire a high dynamic range image of the current scene. As a result, the accuracy of the backlight detection of the shooting scene is improved, thereby ensuring the quality of the shooting picture and improving the user experience.
为了实现上述实施例,本发明还提出了一种计算机可读存储介质。In order to realize the above embodiments, the present invention also provides a computer-readable storage medium.
该计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面实施例的高动态范围图像获取方法。其中高动态范围图像方法包括:从自动曝光控制系统中,获取与当前场景对应的亮度信息;根据所述当前场景对应的亮度信息,确定所述当前场景对应的像素比例阈值及亮度阈值;确定所述当前场景对应的各颜色通道直方图,其中各颜色通道直方图包括各颜色通道下的不同亮度与像素比例的对应关系;根据所述当前场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前是否为逆光拍摄;在确定当前为逆光拍摄时,利用高动态范围图像拍摄模式获取所述当前场景的高动态范围图像。The computer-readable storage medium has a computer program stored thereon, and when the program is executed by the processor, implements the high dynamic range image acquisition method of the embodiment of the first aspect. The high dynamic range image method includes: obtaining brightness information corresponding to the current scene from an automatic exposure control system; determining a pixel ratio threshold and a brightness threshold corresponding to the current scene according to the brightness information corresponding to the current scene; Each color channel histogram corresponding to the current scene, wherein each color channel histogram includes the corresponding relationship between different brightness and pixel ratio under each color channel; according to the pixel ratio threshold, brightness threshold and each color channel histogram corresponding to the current scene Figure, determine whether the current is backlit shooting; when it is determined that the current is backlit shooting, use the high dynamic range image shooting mode to acquire the high dynamic range image of the current scene.
在本发明中,除非另有明确的规定和限定,术语“设置”、“连接”等术语应做广义理解,例如,可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系,除非另有明确的限定。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the present invention, unless otherwise expressly specified and limited, terms such as "arrangement" and "connection" should be understood in a broad sense, for example, it may be a mechanical connection or an electrical connection; it may be a direct connection or an electrical connection. The intermediary is indirectly connected, and may be the internal communication between two elements or the interaction relationship between the two elements, unless otherwise expressly defined. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structure, material or feature is included in at least one embodiment or example of the present invention.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。In addition, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature delimited with "first", "second" may expressly or implicitly include at least one of that feature.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any description of a process or method in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a specified logical function or step of the process , and the scope of the preferred embodiments of the present invention includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present invention belong.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that various parts of the present invention may be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or a combination of the following techniques known in the art: Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, Programmable Gate Arrays (PGA), Field Programmable Gate Arrays (FPGA), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。Those skilled in the art can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the program can be stored in a computer-readable storage medium. When executed, one or a combination of the steps of the method embodiment is included.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, and the like. Although the embodiments of the present invention have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present invention. Embodiments are subject to variations, modifications, substitutions and variations.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711036202.1A CN107888840B (en) | 2017-10-30 | 2017-10-30 | High dynamic range image acquisition method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711036202.1A CN107888840B (en) | 2017-10-30 | 2017-10-30 | High dynamic range image acquisition method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN107888840A CN107888840A (en) | 2018-04-06 |
| CN107888840B true CN107888840B (en) | 2019-10-15 |
Family
ID=61782904
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711036202.1A Active CN107888840B (en) | 2017-10-30 | 2017-10-30 | High dynamic range image acquisition method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107888840B (en) |
Families Citing this family (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107635102B (en) * | 2017-10-30 | 2020-02-14 | Oppo广东移动通信有限公司 | Method and device for acquiring exposure compensation value of high-dynamic-range image |
| CN108616689B (en) * | 2018-04-12 | 2020-10-02 | Oppo广东移动通信有限公司 | Portrait-based high dynamic range image acquisition method, device and equipment |
| CN108337447A (en) * | 2018-04-12 | 2018-07-27 | Oppo广东移动通信有限公司 | High dynamic range image exposure compensation value acquisition method, device, equipment and medium |
| CN108319940A (en) * | 2018-04-12 | 2018-07-24 | Oppo广东移动通信有限公司 | Face recognition processing method, device, equipment and storage medium |
| TWI695622B (en) * | 2018-09-06 | 2020-06-01 | 華晶科技股份有限公司 | Image processing method and image processing device |
| CN109474791A (en) * | 2018-11-20 | 2019-03-15 | 深圳市趣创科技有限公司 | Image shot by camera controls exposure method, device, terminal and storage medium |
| CN110177207B (en) * | 2019-05-29 | 2023-06-30 | 努比亚技术有限公司 | Backlight image shooting method, mobile terminal and computer readable storage medium |
| CN112995490A (en) * | 2019-12-12 | 2021-06-18 | 华为技术有限公司 | Image processing method, terminal photographing method, medium and system |
| CN113758918B (en) * | 2020-06-04 | 2024-02-27 | 成都数字天空科技有限公司 | Unmanned aerial vehicle system-based material determination method and device |
| CN111770264B (en) * | 2020-06-04 | 2022-04-08 | 深圳明心科技有限公司 | Method and device for improving imaging effect of camera module and camera module |
| CN112261306B (en) * | 2020-09-27 | 2021-10-08 | 厦门亿联网络技术股份有限公司 | Backlight judgment method, device, equipment and storage medium |
| CN113038040B (en) * | 2021-03-03 | 2023-03-24 | 深圳市丛矽微电子科技有限公司 | Event camera, threshold adjusting method and system |
| CN113542608B (en) * | 2021-07-15 | 2022-08-02 | 腾讯科技(深圳)有限公司 | Image processing method and device |
| CN117710265B (en) * | 2022-01-25 | 2024-11-22 | 荣耀终端有限公司 | Image processing method and related equipment |
| CN114898161B (en) * | 2022-06-07 | 2025-01-24 | 东软睿驰汽车技术(沈阳)有限公司 | Camera dirt detection method, device and electronic equipment |
| CN117173623A (en) * | 2022-06-21 | 2023-12-05 | 惠州Tcl移动通信有限公司 | A video imaging method, device, computer equipment and storage medium |
| CN115190242B (en) * | 2022-07-08 | 2024-02-13 | 杭州海康威视数字技术股份有限公司 | Focusing triggering method and device |
| CN118628368B (en) * | 2024-08-08 | 2024-11-08 | 爱芯元智半导体股份有限公司 | Method, device, equipment and medium for obtaining fusion ratio of HDR image |
Citations (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1492380A (en) * | 2002-09-20 | 2004-04-28 | ������������ʽ���� | Backlighting processing of images using image generation history information |
| JP2007267188A (en) * | 2006-03-29 | 2007-10-11 | Seiko Epson Corp | Backlight image determination apparatus, backlight image determination method, backlight image determination program, backlight image correction apparatus, backlight image correction method, image reading apparatus, image reading method, and printing apparatus |
| CN101137012A (en) * | 2006-07-25 | 2008-03-05 | 富士胶片株式会社 | Screening device, method and program |
| US7916942B1 (en) * | 2006-06-02 | 2011-03-29 | Seiko Epson Corporation | Image determining apparatus, image enhancement apparatus, backlight image enhancement apparatus, and backlight image enhancement method |
| CN102129674A (en) * | 2010-12-17 | 2011-07-20 | 北京优纳科技有限公司 | Self-adaptation color balance correction method for color image |
| CN102376270A (en) * | 2010-08-23 | 2012-03-14 | 三美电机株式会社 | Brightness control apparatus and brightness control method |
| CN103646392A (en) * | 2013-11-21 | 2014-03-19 | 华为技术有限公司 | A backlight detection method and a device |
| CN103905737A (en) * | 2012-12-25 | 2014-07-02 | 联想(北京)有限公司 | Backlight detection method and device |
| CN104050676A (en) * | 2014-06-30 | 2014-09-17 | 成都品果科技有限公司 | Backlighting image detection method and device based on Logistic regression model |
| CN104202524A (en) * | 2014-09-02 | 2014-12-10 | 三星电子(中国)研发中心 | Method and device for backlight filming |
| CN105100632A (en) * | 2014-05-13 | 2015-11-25 | 北京展讯高科通信技术有限公司 | Adjusting method and apparatus for automatic exposure of imaging device, and imaging device |
| CN105227843A (en) * | 2015-10-20 | 2016-01-06 | 宇龙计算机通信科技(深圳)有限公司 | The filming control method of terminal, the imaging control device of terminal and terminal |
| CN105611140A (en) * | 2015-07-31 | 2016-05-25 | 宇龙计算机通信科技(深圳)有限公司 | Photographing control method, photographing control device and terminal |
| CN105933617A (en) * | 2016-05-19 | 2016-09-07 | 中国人民解放军装备学院 | High dynamic range image fusion method used for overcoming influence of dynamic problem |
| CN106067024A (en) * | 2015-04-01 | 2016-11-02 | 息科安宝 | Feature point extraction device and method and the image matching system utilizing it |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8014602B2 (en) * | 2006-03-29 | 2011-09-06 | Seiko Epson Corporation | Backlight image determining apparatus, backlight image determining method, backlight image correction apparatus, and backlight image correction method |
-
2017
- 2017-10-30 CN CN201711036202.1A patent/CN107888840B/en active Active
Patent Citations (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1492380A (en) * | 2002-09-20 | 2004-04-28 | ������������ʽ���� | Backlighting processing of images using image generation history information |
| JP2007267188A (en) * | 2006-03-29 | 2007-10-11 | Seiko Epson Corp | Backlight image determination apparatus, backlight image determination method, backlight image determination program, backlight image correction apparatus, backlight image correction method, image reading apparatus, image reading method, and printing apparatus |
| US7916942B1 (en) * | 2006-06-02 | 2011-03-29 | Seiko Epson Corporation | Image determining apparatus, image enhancement apparatus, backlight image enhancement apparatus, and backlight image enhancement method |
| CN101137012A (en) * | 2006-07-25 | 2008-03-05 | 富士胶片株式会社 | Screening device, method and program |
| CN102376270A (en) * | 2010-08-23 | 2012-03-14 | 三美电机株式会社 | Brightness control apparatus and brightness control method |
| CN102129674A (en) * | 2010-12-17 | 2011-07-20 | 北京优纳科技有限公司 | Self-adaptation color balance correction method for color image |
| CN103905737A (en) * | 2012-12-25 | 2014-07-02 | 联想(北京)有限公司 | Backlight detection method and device |
| CN103646392A (en) * | 2013-11-21 | 2014-03-19 | 华为技术有限公司 | A backlight detection method and a device |
| CN105100632A (en) * | 2014-05-13 | 2015-11-25 | 北京展讯高科通信技术有限公司 | Adjusting method and apparatus for automatic exposure of imaging device, and imaging device |
| CN104050676A (en) * | 2014-06-30 | 2014-09-17 | 成都品果科技有限公司 | Backlighting image detection method and device based on Logistic regression model |
| CN104202524A (en) * | 2014-09-02 | 2014-12-10 | 三星电子(中国)研发中心 | Method and device for backlight filming |
| CN106067024A (en) * | 2015-04-01 | 2016-11-02 | 息科安宝 | Feature point extraction device and method and the image matching system utilizing it |
| CN105611140A (en) * | 2015-07-31 | 2016-05-25 | 宇龙计算机通信科技(深圳)有限公司 | Photographing control method, photographing control device and terminal |
| CN105227843A (en) * | 2015-10-20 | 2016-01-06 | 宇龙计算机通信科技(深圳)有限公司 | The filming control method of terminal, the imaging control device of terminal and terminal |
| CN105933617A (en) * | 2016-05-19 | 2016-09-07 | 中国人民解放军装备学院 | High dynamic range image fusion method used for overcoming influence of dynamic problem |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107888840A (en) | 2018-04-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107888840B (en) | High dynamic range image acquisition method and device | |
| CN107635102B (en) | Method and device for acquiring exposure compensation value of high-dynamic-range image | |
| US11563897B2 (en) | Image processing method and apparatus which determines an image processing mode based on status information of the terminal device and photographing scene information | |
| CN108616689B (en) | Portrait-based high dynamic range image acquisition method, device and equipment | |
| US9407831B2 (en) | Intelligent auto-exposure bracketing | |
| US8106965B2 (en) | Image capturing device which corrects a target luminance, based on which an exposure condition is determined | |
| CN104349070B (en) | High dynamic range image exposure time control method | |
| CN103826066B (en) | Automatic exposure adjusting method and system | |
| CN108337447A (en) | High dynamic range image exposure compensation value acquisition method, device, equipment and medium | |
| CN108337446B (en) | High dynamic range image acquisition method, device and equipment based on double cameras | |
| US11496694B2 (en) | Dual sensor imaging system and imaging method thereof | |
| CN108337449A (en) | High dynamic range image acquisition method, device and equipment based on double cameras | |
| CN107888839B (en) | High dynamic range image acquisition method, device and device | |
| CN112653845B (en) | Exposure control method, exposure control device, electronic equipment and readable storage medium | |
| CN107948538A (en) | Imaging method, device, mobile terminal and storage medium | |
| CN103516984A (en) | Method and device for intelligently switching HDR mode of camera | |
| CN107396079A (en) | Method and device for adjusting white balance | |
| WO2020034739A1 (en) | Control method and apparatus, electronic device, and computer readable storage medium | |
| US20100328488A1 (en) | Apparatus, methods and computer readable storage mediums | |
| CN113747062B (en) | HDR scene detection method and device, terminal and readable storage medium | |
| CN115914850A (en) | Method, electronic device and storage medium for enhancing wide dynamic image transparency | |
| CN114143418B (en) | Dual-sensor imaging system and imaging method thereof | |
| CN108337448B (en) | High dynamic range image acquisition method and device, terminal equipment and storage medium | |
| CN111970501A (en) | Pure color scene AE color processing method and device, electronic equipment and storage medium | |
| US11568526B2 (en) | Dual sensor imaging system and imaging method thereof |
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 | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: OPPO Guangdong Mobile Communications Co., Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: Guangdong OPPO Mobile Communications Co., Ltd. |
|
| GR01 | Patent grant | ||
| GR01 | Patent grant |