WO2023060762A1 - Image processing method and apparatus, and computer-readable storage medium - Google Patents

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

Info

Publication number
WO2023060762A1
WO2023060762A1 PCT/CN2021/139608 CN2021139608W WO2023060762A1 WO 2023060762 A1 WO2023060762 A1 WO 2023060762A1 CN 2021139608 W CN2021139608 W CN 2021139608W WO 2023060762 A1 WO2023060762 A1 WO 2023060762A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
brightness
overexposed
exposure time
overexposure
Prior art date
Application number
PCT/CN2021/139608
Other languages
French (fr)
Chinese (zh)
Inventor
王鹏
余明火
张光宇
刘翔章
赵盖
Original Assignee
深圳创维-Rgb电子有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳创维-Rgb电子有限公司 filed Critical 深圳创维-Rgb电子有限公司
Publication of WO2023060762A1 publication Critical patent/WO2023060762A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

An image processing method and apparatus, and a computer-readable storage medium. The method comprises: acquiring an overexposed image, and acquiring a portrait target area in the overexposed image (S100); acquiring an average pixel effective brightness value of each portrait target area (S200); acquiring through calculation a secondary exposure time, on the basis of a current exposure time, an overexposed brightness threshold, and the average pixel effective brightness value (S300); acquiring a secondary exposure image on the basis of the secondary exposure time, and on the basis of the overexposed image and the secondary exposure image, acquiring a target image after overexposure correction processing is completed (S400). In the present method, photographed objects having a large brightness difference in the same scene are well recorded in the same target image, so that the degree of clarity of the obtained target image is increased, and the image recording effect is improved.

Description

图像处理方法、装置及计算机可读存储介质Image processing method, device and computer-readable storage medium 技术领域technical field
本申请涉及图像处理技术领域,例如涉及一种图像处理方法、装置及计算机可读存储介质。The present application relates to the technical field of image processing, for example, to an image processing method, device, and computer-readable storage medium.
背景技术Background technique
随着科学技术的发展,摄像设备也迅速发展并应用于各个场景中,例如,在智慧教室、远程会议等应用场景下,都可以通过摄像头采集图像。但在通过摄像头采集图像的过程中,可能由于场景中局部区域亮度太高而导致采集的图像无法正常记录当前场景。例如,在智慧教室场景下,在教室亮度不高且显示屏设备亮度过高时,摄像机以教师为准调整自动曝光时,拍摄图像的显示屏部分会过度曝光,导致该部分内容不清楚。With the development of science and technology, camera equipment is also rapidly developed and applied in various scenarios. For example, in application scenarios such as smart classrooms and remote conferences, images can be collected through cameras. However, in the process of collecting images through the camera, the collected images may not be able to record the current scene normally due to the high brightness of local areas in the scene. For example, in a smart classroom scenario, when the brightness of the classroom is not high and the brightness of the display device is too high, when the camera adjusts the automatic exposure based on the teacher, the part of the display screen that captures the image will be overexposed, making the content of this part unclear.
现有技术中,通常在画面出现过度曝光时调整曝光时间,以获得显示效果更好的图像。现有技术的问题在于,单纯调整曝光时间,无论如何进行调整,都无法将同一场景下亮度差异过大的拍摄对象良好地记录在同一画面中,不利于提升获得的图像的清楚程度,且影响图像记录效果。In the prior art, the exposure time is usually adjusted when the picture is overexposed, so as to obtain an image with better display effect. The problem with the existing technology is that simply adjusting the exposure time, no matter how you adjust it, can’t record the subjects with large brightness differences in the same scene well in the same frame, which is not conducive to improving the clarity of the obtained image, and affects Image recording effect.
因此,现有技术还有待改进和发展。Therefore, the prior art still needs to be improved and developed.
申请内容application content
本申请的主要目的在于提供一种图像处理方法、装置及计算机可读存储介质,旨在解决现有技术中调整曝光时间的方案无法将同一场景下亮度差异过大的拍摄对象良好的记录在同一画面中,不利于提升获得的图像的清楚程度,且影响图像记录效果的问题。The main purpose of the present application is to provide an image processing method, device, and computer-readable storage medium, aiming at solving the problem that the solution of adjusting the exposure time in the prior art cannot record objects with large brightness differences in the same scene well in the same scene. In the picture, it is not conducive to improving the clarity of the obtained image, and affects the image recording effect.
为了实现上述目的,本申请第一方面提供一种图像处理方法,其中,上述方法包括:In order to achieve the above purpose, the first aspect of the present application provides an image processing method, wherein the above method includes:
获取过曝图像,并获取上述过曝图像中的人像目标区域;Obtain an overexposed image, and obtain the portrait target area in the above overexposed image;
分别获取各上述人像目标区域的像素有效亮度均值;Respectively obtain the pixel effective luminance mean value of each of the above-mentioned portrait target areas;
基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间;Calculate and obtain the secondary exposure time based on the current exposure time, the overexposure brightness threshold and the average value of the effective brightness of the above-mentioned pixels;
基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取一张完成过曝修正处理后的目标图像。A secondary exposure image is acquired based on the secondary exposure time, and a target image after overexposure correction processing is acquired based on the overexposure image and the secondary exposure image.
可选的,上述获取过曝图像,并获取上述过曝图像中的人像目标区域,包括:Optionally, the above-mentioned acquisition of the over-exposed image, and acquisition of the portrait target area in the above-mentioned over-exposure image, including:
获取待处理图像;Get the image to be processed;
基于上述过曝亮度阈值获取上述待处理图像中的过曝像素,其中,上述过曝像素的亮 度值大于上述过曝亮度阈值;Obtaining the overexposed pixels in the image to be processed based on the above-mentioned overexposure brightness threshold, wherein the brightness value of the above-mentioned overexposed pixels is greater than the above-mentioned overexposure brightness threshold;
当上述待处理图像中过曝像素的数量占比高于预设的过曝像素比例时,将上述待处理图像作为过曝图像;When the ratio of the number of overexposed pixels in the image to be processed is higher than the preset ratio of overexposed pixels, the image to be processed is used as an overexposed image;
获取上述过曝图像中的人像目标区域。Get the portrait target area in the above overexposed image.
可选的,上述获取待处理图像,包括:通过摄像机自动曝光技术获取上述待处理图像。Optionally, the acquiring the image to be processed includes: acquiring the image to be processed by using a camera automatic exposure technology.
可选的,上述基于上述过曝亮度阈值获取上述待处理图像中的过曝像素,包括:Optionally, the acquisition of the overexposed pixels in the image to be processed based on the above overexposure brightness threshold includes:
将上述待处理图像的色彩空间转换到HSL模型中,将转换后的上述待处理图像中亮度值大于上述过曝亮度阈值的像素作为上述过曝像素。The color space of the image to be processed is converted into an HSL model, and pixels whose luminance values are greater than the overexposed brightness threshold in the converted image to be processed are used as the overexposed pixels.
可选的,上述过曝亮度阈值为0.9。Optionally, the above-mentioned overexposure brightness threshold is 0.9.
可选的,上述获取上述过曝图像中的人像目标区域,包括:Optionally, the aforementioned acquisition of the portrait target area in the aforementioned overexposed image includes:
对上述过曝图像进行人脸识别;Perform face recognition on the above-mentioned overexposed image;
将识别获得的各个人脸对应的区域分别作为上述人像目标区域。The regions corresponding to the recognized faces are respectively used as the above-mentioned portrait target regions.
可选的,上述分别获取各上述人像目标区域的像素有效亮度均值,包括:Optionally, the above method respectively obtains the pixel effective brightness mean value of each of the above portrait target areas, including:
对于每一个上述人像目标区域,计算上述人像目标区域内的有效像素的亮度值的均值,作为上述人像目标区域的像素有效亮度均值,其中,上述有效像素是亮度值不小于第一亮度阈值且不大于第二亮度阈值的像素,上述第一亮度阈值等于区域亮度均值减去区域标准差,上述第二亮度阈值等于区域亮度均值加上区域标准差,上述区域亮度均值和上述区域标准差分别是上述人像目标区域内所有像素的亮度值的均值和标准差。For each of the above-mentioned portrait target areas, calculate the average value of the brightness values of the effective pixels in the above-mentioned portrait target area, as the pixel effective brightness average value of the above-mentioned portrait target area, wherein, the brightness value of the above-mentioned effective pixels is not less than the first brightness threshold and not For pixels greater than the second brightness threshold, the first brightness threshold is equal to the regional brightness mean minus the regional standard deviation, the second brightness threshold is equal to the regional brightness mean plus the regional standard deviation, and the regional brightness mean and the regional standard deviation are respectively the above The mean and standard deviation of the brightness values of all pixels within the portrait target area.
可选的,上述基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间,包括:Optionally, the above-mentioned calculation and acquisition of the secondary exposure time based on the current exposure time, the over-exposure brightness threshold and the above-mentioned pixel effective brightness average value include:
计算所有上述人像目标区域的像素有效亮度均值的均值,作为图像有效亮度均值;Calculate the mean value of the pixel effective brightness mean value of all the above-mentioned portrait target regions as the image effective brightness mean value;
计算获取二次曝光时间,其中,上述二次曝光时间等于上述图像有效亮度均值与上述当前曝光时间的乘积除以上述过曝亮度阈值。The secondary exposure time is calculated and obtained, wherein the secondary exposure time is equal to the product of the effective average brightness of the image and the current exposure time divided by the over-exposure brightness threshold.
可选的,上述计算所有上述人像目标区域的像素有效亮度均值的均值,作为图像有效亮度均值,包括:Optionally, the above calculation of the mean value of the mean value of the pixel effective brightness of all the above-mentioned portrait target regions is used as the mean value of the effective brightness of the image, including:
计算
Figure PCTCN2021139608-appb-000001
其中,k为1到N之间的正整数,L(k)代表像素有效亮度均值数组的第k个元素,N代表上述人像目标区域的总数,L'代表上述图像有效亮度均值,上述像素有效亮度均值数组是所有上述人像目标区域的像素有效亮度均值组成的数组。
calculate
Figure PCTCN2021139608-appb-000001
Among them, k is a positive integer between 1 and N, L(k) represents the kth element of the pixel effective brightness average value array, N represents the total number of the above-mentioned portrait target areas, L' represents the effective brightness average value of the above-mentioned image, and the effective brightness of the above-mentioned pixels The brightness mean value array is an array composed of the pixel effective brightness mean values of all the above-mentioned portrait target regions.
可选的,上述计算获取二次曝光时间,包括:Optionally, the above calculation obtains the secondary exposure time, including:
计算
Figure PCTCN2021139608-appb-000002
其中,T'为上述二次曝光时间,T为上述待处理图像对应的当前曝光时间,L 1为上述过曝亮度阈值,L'为上述图像有效亮度均值。
calculate
Figure PCTCN2021139608-appb-000002
Wherein, T' is the above-mentioned secondary exposure time, T is the current exposure time corresponding to the above-mentioned image to be processed, L1 is the above-mentioned overexposure brightness threshold, and L' is the average value of the effective brightness of the above-mentioned image.
可选的,上述基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取一张完成过曝修正处理后的目标图像,包括:Optionally, the aforementioned acquisition of a secondary exposure image based on the aforementioned secondary exposure time, and acquisition of a target image after completion of overexposure correction processing based on the aforementioned overexposed image and the aforementioned secondary exposure image, including:
基于上述二次曝光时间进行拍摄,获取二次曝光图像;Taking pictures based on the above-mentioned secondary exposure time to obtain a secondary exposure image;
基于上述二次曝光图像对上述过曝图像进行修正,获取目标图像。The above-mentioned overexposed image is corrected based on the above-mentioned double-exposure image to obtain a target image.
可选的,上述基于上述二次曝光时间进行拍摄,获取二次曝光图像,包括:Optionally, the above-mentioned shooting is performed based on the above-mentioned secondary exposure time to obtain a secondary exposure image, including:
基于上述二次曝光时间控制摄像机进行拍摄,将拍摄获得的图像作为上述二次曝光图像。The camera is controlled to shoot based on the above-mentioned secondary exposure time, and the image obtained by shooting is used as the above-mentioned secondary exposure image.
可选的,上述基于上述二次曝光图像对上述过曝图像进行修正,获取目标图像,包括:Optionally, the above-mentioned overexposed image is corrected based on the above-mentioned secondary exposure image to obtain a target image, including:
将上述过曝图像中的过曝像素替换为上述二次曝光图像中的相应像素,获得目标图像,其中,上述过曝像素的亮度值大于上述过曝亮度阈值。A target image is obtained by replacing the overexposed pixels in the overexposed image with corresponding pixels in the double exposure image, wherein the brightness value of the overexposed pixel is greater than the overexposed brightness threshold.
本申请第二方面提供一种图像处理装置,其中,上述装置包括:The second aspect of the present application provides an image processing device, wherein the above-mentioned device includes:
过曝图像获取模块,用于获取过曝图像,并获取上述过曝图像中的人像目标区域;An over-exposed image acquisition module, configured to acquire an over-exposed image, and obtain the portrait target area in the above-mentioned over-exposed image;
均值获取模块,用于分别获取各上述人像目标区域的像素有效亮度均值;Mean value acquisition module, used to respectively obtain the pixel effective luminance mean value of each above-mentioned portrait target area;
二次曝光时间获取模块,用于基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间;The secondary exposure time acquisition module is used to calculate and obtain the secondary exposure time based on the current exposure time, the overexposure brightness threshold and the above-mentioned pixel effective brightness average;
处理模块,用于基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取处理后的目标图像。A processing module, configured to acquire a secondary exposure image based on the secondary exposure time, and acquire a processed target image based on the overexposed image and the secondary exposure image.
本申请第三方面提供一种计算机可读存储介质,上述计算机可读存储介质上存储有图像处理程序,上述图像处理程序被处理器执行时实现任意一项上述图像处理方法的步骤。A third aspect of the present application provides a computer-readable storage medium, where an image processing program is stored on the computer-readable storage medium, and when the image processing program is executed by a processor, any one of the steps of the above-mentioned image processing method is implemented.
由上可见,本申请方案中,获取过曝图像,并获取上述过曝图像中的人像目标区域;分别获取各上述人像目标区域的像素有效亮度均值;基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间;基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取一张完成过曝修正处理后的目标图像。与现有技术中单纯调整曝光时间的方案相比,本申请方案中,获取当前过曝图像对应的二次曝光时间,基于二次曝光时间获取二次曝光图像后,结合当前的过曝图像和获得的二次曝光图像获取一张完成过曝修正处理后的目标图像,有利于将同一场景下亮度差异较大的拍摄对象都良好地记录在同一目标图像中,有利于提升获得的目标图像的清楚程度,提升图像记录效果。It can be seen from the above that in the scheme of this application, the overexposed image is obtained, and the portrait target area in the above overexposed image is obtained; the pixel effective brightness average value of each of the above portrait target areas is obtained respectively; based on the current exposure time, the overexposure brightness threshold and the above-mentioned The second exposure time is obtained by calculating the mean value of the effective brightness of the pixels; a second exposure image is obtained based on the above second exposure time, and a target image after overexposure correction processing is obtained based on the above overexposure image and the above second exposure image. Compared with the scheme of simply adjusting the exposure time in the prior art, in the scheme of the present application, the secondary exposure time corresponding to the current overexposed image is obtained, and after the secondary exposure image is obtained based on the secondary exposure time, the current overexposed image and the Obtained double exposure image Acquisition of a target image after overexposure correction processing is conducive to recording objects with large brightness differences in the same scene in the same target image, which is conducive to improving the quality of the obtained target image. Clearness, improve image recording effect.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings that need to be used in the descriptions of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are only for the present application For some embodiments, those skilled in the art can also obtain other drawings according to these drawings without paying creative efforts.
图1是本申请实施例提供的一种图像处理方法的流程示意图;FIG. 1 is a schematic flow diagram of an image processing method provided in an embodiment of the present application;
图2是本申请实施例图1中步骤S100的具体流程示意图;FIG. 2 is a schematic flowchart of step S100 in FIG. 1 of the embodiment of the present application;
图3是本申请实施例图2中步骤S104的具体流程示意图;FIG. 3 is a schematic flowchart of step S104 in FIG. 2 of the embodiment of the present application;
图4是本申请实施例提供的一个人像目标区域对应的亮度值分布示意图;FIG. 4 is a schematic diagram of the brightness value distribution corresponding to a portrait target area provided by the embodiment of the present application;
图5是本申请实施例图1中步骤S300的具体流程示意图;Fig. 5 is a specific flow diagram of step S300 in Fig. 1 of the embodiment of the present application;
图6是本申请实施例图1中步骤S400的具体流程示意图;Fig. 6 is a specific flow diagram of step S400 in Fig. 1 of the embodiment of the present application;
图7是本申请实施例提供的一种图像处理方法的具体流程示意图;FIG. 7 is a schematic flow chart of an image processing method provided in an embodiment of the present application;
图8是本申请实施例提供的一种图像处理装置的结构示意图;FIG. 8 is a schematic structural diagram of an image processing device provided in an embodiment of the present application;
图9是本申请实施例提供的一种智能终端的内部结构原理框图。FIG. 9 is a functional block diagram of an internal structure of a smart terminal provided by an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况下,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude one or more other features. , whole, step, operation, element, component and/or the presence or addition of a collection thereof.
还应当理解,在本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terminology used in the specification of the present application is for the purpose of describing specific embodiments only and is not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural referents unless the context clearly dictates otherwise.
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be further understood that the term "and/or" used in the description of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations .
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当…时”或“一旦”或“响应于确定”或“响应于检测到”。类似的,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或 “一旦检测到[所描述的条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" may be construed as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrases "if determined" or "if detected [the described condition or event]" may be construed, depending on the context, to mean "once determined" or "in response to the determination" or "once detected [the described condition or event]" event]" or "in response to detection of [described condition or event]".
下面结合本申请实施例的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
在下面的描述中阐述了很多具体细节以便于充分理解本申请,但是本申请还可以采用其它不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本申请内涵的情况下做类似推广,因此本申请不受下面公开的具体实施例的限制。In the following description, a lot of specific details are set forth in order to fully understand the application, but the application can also be implemented in other ways different from those described here, and those skilled in the art can do it without violating the content of the application. By analogy, the present application is therefore not limited by the specific embodiments disclosed below.
随着科学技术的发展,摄像设备也迅速发展并应用于各个场景中,例如,在智慧教室、远程会议等应用场景下,都可以通过摄像头采集图像。但在通过摄像头采集图像的过程中,可能由于场景中局部区域亮度太高而导致采集的图像无法正常记录当前场景。例如,摄像机是智慧教室系统必备且重要的一种设备,智慧教室中的摄像机拍摄教师教学的过程,用于教学记录和远程推流。但智慧教室的显示屏设备有时会因为亮度太高而无法正常记录。具体的,在智慧教室场景下,在教室亮度不高且显示屏设备亮度过高时,摄像机以教师为准调整自动曝光时,拍摄图像的显示屏部分会过度曝光,导致该部分内容不清楚。With the development of science and technology, camera equipment is also rapidly developed and applied in various scenarios. For example, in application scenarios such as smart classrooms and remote conferences, images can be collected through cameras. However, in the process of collecting images through the camera, the collected images may not be able to record the current scene normally due to the high brightness of local areas in the scene. For example, a camera is an essential and important device in a smart classroom system. The camera in a smart classroom captures the teaching process of the teacher and is used for teaching recording and remote streaming. However, the display device of the smart classroom sometimes cannot record normally because the brightness is too high. Specifically, in the smart classroom scenario, when the brightness of the classroom is not high and the brightness of the display device is too high, when the camera adjusts the automatic exposure based on the teacher, the part of the display screen that captures the image will be overexposed, making the content of this part unclear.
现有技术中,通常在画面出现过度曝光时调整曝光时间,以获得显示效果更好的图像。现有技术的问题在于,单纯调整曝光时间,无论如何进行调整,都无法将同一场景下亮度差异过大的拍摄对象良好地记录在同一画面中,不利于提升获得的图像的清楚程度,且影响图像记录效果。在一些应用场景中,还通过卷积法进行图像修复,但卷积法会耗费大量曝光时间,无法应用在动态场景中进行实时记录。而无法记录显示屏信息的情况会引起教学内容的记录不全、远程学生无法观察到显示屏上的教学内容等问题,影响正常教学功能和用户的使用体验。In the prior art, the exposure time is usually adjusted when the picture is overexposed, so as to obtain an image with better display effect. The problem with the existing technology is that simply adjusting the exposure time, no matter how you adjust it, can’t record the subjects with large brightness differences in the same scene well in the same frame, which is not conducive to improving the clarity of the obtained image, and affects Image recording effect. In some application scenarios, the convolution method is also used for image restoration, but the convolution method consumes a lot of exposure time and cannot be applied to real-time recording in dynamic scenes. The failure to record the display screen information will cause incomplete recording of the teaching content, remote students cannot observe the teaching content on the display screen, etc., which will affect the normal teaching function and user experience.
为了解决现有技术的问题,本申请方案中,获取过曝图像,并获取上述过曝图像中的人像目标区域;分别获取各上述人像目标区域的像素有效亮度均值;基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间;基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取一张完成过曝修正处理后的目标图像。与现有技术中单纯调整曝光时间的方案相比,本申请方案中,获取当前过曝图像对应的二次曝光时间,基于二次曝光时间获取二次曝光图像后,结合当前的过曝图像和获得的二次曝光图像获取一张完成过曝修正处理后的目标图像,有利于将同一场景下亮度差异较大的拍摄对象都良好地记录在同一目标图像中,有利于提升获得的目标图像的清楚程度,提升图像记录效果。In order to solve the problems of the prior art, in the scheme of the present application, the overexposed image is obtained, and the portrait target area in the above-mentioned overexposed image is obtained; the pixel effective brightness mean value of each of the above-mentioned portrait target areas is obtained respectively; based on the current exposure time, the overexposure The brightness threshold and the average value of the effective brightness of the above pixels are calculated to obtain the secondary exposure time; the secondary exposure image is obtained based on the secondary exposure time, and a target after the overexposure correction process is obtained based on the above overexposure image and the above secondary exposure image image. Compared with the scheme of simply adjusting the exposure time in the prior art, in the scheme of the present application, the secondary exposure time corresponding to the current overexposed image is obtained, and after the secondary exposure image is obtained based on the secondary exposure time, the current overexposed image and the Obtained double exposure image Acquisition of a target image after overexposure correction processing is conducive to recording objects with large brightness differences in the same scene in the same target image, which is conducive to improving the quality of the obtained target image. Clearness, improve image recording effect.
实施例1Example 1
如图1所示,本申请实施例提供一种图像处理方法,具体的,上述方法包括如下步骤:As shown in Figure 1, the embodiment of the present application provides an image processing method, specifically, the above method includes the following steps:
步骤S100,获取过曝图像,并获取上述过曝图像中的人像目标区域。Step S100, acquiring an overexposed image, and acquiring a portrait target area in the overexposed image.
其中,上述过曝图像是对目标对象拍摄获得的存在部分区域过度曝光的图像,目标对象是需要通过图像进行记录的对象。本实施例中,以智慧教室的应用场景为例进行说明,则目标对象包括教室内的师生以及显示屏,还可以包括黑板等包含教学信息的区域。在其它应用场景中,目标对象还可以为其它对象,例如智能会议场景下目标对象可以包括与会人员和会议播放显示屏,在此不做具体限定。Wherein, the above-mentioned overexposed image is an image obtained by photographing a target object with partial area overexposure, and the target object is an object that needs to be recorded through the image. In this embodiment, the application scenario of a smart classroom is taken as an example for illustration, and the target objects include teachers and students in the classroom and display screens, and may also include areas containing teaching information such as blackboards. In other application scenarios, the target object may also be other objects. For example, in a smart conference scenario, the target object may include participants and a conference playback display screen, which is not specifically limited here.
上述人像目标区域是过曝图像中人脸对应的区域。目前的摄像头通常是以人脸为准调整自动曝光的,人脸区域对应的曝光通常是正常的,不会出现太强的过曝光情况,因此获取过曝图像中的人像目标区域有助于快速获取过曝图像中亮度正常的像素点,从而便于获知过曝图像的过曝程度,进而便于调整二次曝光时间,对过曝光区域进行补偿修正。本实施例中,在智慧教室的应用场景下,过曝图像中人脸包括老师的人脸和学生的人脸。The aforementioned portrait target area is an area corresponding to a human face in the overexposed image. The current camera usually adjusts the automatic exposure based on the face. The exposure corresponding to the face area is usually normal, and there will not be too strong overexposure. Therefore, obtaining the target area of the portrait in the overexposed image is helpful to quickly Pixels with normal brightness in the over-exposed image are obtained, so as to facilitate knowing the degree of over-exposure of the over-exposed image, thereby facilitating adjustment of the secondary exposure time, and compensation and correction of the over-exposed area. In this embodiment, in the application scenario of the smart classroom, the faces in the overexposed image include the faces of the teacher and the faces of the students.
步骤S200,分别获取各上述人像目标区域的像素有效亮度均值。In step S200, obtain the pixel effective luminance mean value of each of the above-mentioned portrait target areas respectively.
其中,一个人像目标区域对应一个像素有效亮度均值,像素有效亮度均值是对应的人像目标区域内的所有有效像素的亮度值的均值,其中,有效像素是不过暗也不过亮的像素。例如,在一种应用场景中,有效像素是对应的人像目标区域内亮度值在预设范围内的像素。在上述步骤S200中,分别计算获取每一个人像目标区域对应的像素有效亮度均值。Wherein, a portrait target area corresponds to a pixel effective mean brightness, which is the mean value of the brightness values of all effective pixels in the corresponding portrait target area, wherein an effective pixel is a pixel that is neither too dark nor too bright. For example, in an application scenario, valid pixels are pixels whose luminance values are within a preset range in the corresponding portrait target area. In the above step S200, the mean value of effective brightness of pixels corresponding to each portrait target area is calculated and acquired respectively.
步骤S300,基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间。Step S300 , calculating and obtaining a secondary exposure time based on the current exposure time, the overexposure brightness threshold, and the above average pixel effective brightness.
具体的,曝光时间是为了将光投射到照相感光材料的感光面上,快门所要打开的时间。其中,上述当前曝光时间是当前的过曝图像对应的曝光时间,即上述过曝图像是基于当前曝光时间拍摄获得的图像。过曝亮度阈值是预先设置的亮度阈值,考虑过度曝光的情况,当某一像素点对应的亮度值超过上述过曝亮度阈值时,认为该点过度曝光。上述过曝亮度阈值可以根据实际需求进行设置和调整。在一种应用场景中,可以直接减小当前曝光时间后作为二次曝光时间,从而以第二次低曝光时间的手段来获取场景内局部过曝的物体的信息。在本实施例中,基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值对二次曝光时间进行准确地计算,以保证能充分获取到场景内局部过曝的物体的信息,同时减小所需要的等待和计算时间,提高实时性,满足课堂的实时性需求。Specifically, the exposure time is the time for the shutter to be opened in order to project light onto the photosensitive surface of the photographic photosensitive material. Wherein, the above-mentioned current exposure time is the exposure time corresponding to the current over-exposed image, that is, the above-mentioned over-exposed image is an image obtained by shooting based on the current exposure time. The overexposure brightness threshold is a preset brightness threshold. Considering the situation of overexposure, when the brightness value corresponding to a certain pixel exceeds the above-mentioned overexposure brightness threshold, it is considered that the point is overexposed. The above-mentioned overexposure brightness threshold may be set and adjusted according to actual needs. In one application scenario, the current exposure time can be directly reduced as the second exposure time, so as to acquire information of partially overexposed objects in the scene by means of the second lower exposure time. In this embodiment, the secondary exposure time is accurately calculated based on the current exposure time, the overexposure brightness threshold, and the above average pixel effective brightness, so as to ensure that the information of locally overexposed objects in the scene can be fully obtained, and at the same time reduce The required waiting and calculation time can improve real-time performance and meet the real-time performance requirements of the classroom.
步骤S400,基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取一张完成过曝修正处理后的目标图像。In step S400, a secondary exposure image is acquired based on the secondary exposure time, and a target image after overexposure correction processing is acquired based on the overexposure image and the secondary exposure image.
具体的,获得二次曝光时间后,基于二次曝光时间获取二次曝光图像。二次曝光时间是根据当前的过曝图像的亮度值情况进行计算获得的,可以保证获得的二次曝光图像中,与当前过曝图像中过度曝光的区域对应的区域是正常的(不过度曝光的),从而可以结合过曝图像和二次曝光图像获取一张完成过曝修正的更为清楚的目标图像。在上述目标图像中,当前场景下的各个目标对象(包括师生人脸和显示屏显示的内容)都清晰可见,不会因为过度曝光而导致部分内容看不清楚。Specifically, after the second exposure time is obtained, the second exposure image is acquired based on the second exposure time. The secondary exposure time is calculated according to the brightness value of the current overexposed image, which can ensure that in the obtained secondary exposure image, the area corresponding to the overexposed area in the current overexposed image is normal (not overexposed ), so that the over-exposure image and the double-exposure image can be combined to obtain a clearer target image that has completed the over-exposure correction. In the above target image, all target objects in the current scene (including the faces of teachers and students and the content displayed on the display screen) are clearly visible, and some content will not be unclear due to overexposure.
由上可见,本申请实施例提供的图像处理方法中,获取过曝图像,并获取上述过曝图像中的人像目标区域;分别获取各上述人像目标区域的像素有效亮度均值;基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间;基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取一张完成过曝修正处理后的目标图像。与现有技术中单纯调整曝光时间的方案相比,本申请方案中,获取当前过曝图像对应的二次曝光时间,基于二次曝光时间获取二次曝光图像后,结合当前的过曝图像和获得的二次曝光图像获取一张完成过曝修正处理后的目标图像,有利于将同一场景下亮度差异较大的拍摄对象都良好地记录在同一目标图像中,有利于提升获得的目标图像的清楚程度,提升图像记录效果。It can be seen from the above that in the image processing method provided by the embodiment of the present application, the overexposed image is obtained, and the portrait target area in the above-mentioned overexposed image is obtained; the pixel effective brightness average value of each of the above-mentioned portrait target areas is obtained respectively; based on the current exposure time, Calculate the over-exposure brightness threshold and the average value of the effective brightness of the above pixels to obtain the secondary exposure time; obtain the secondary exposure image based on the above secondary exposure time, and obtain an image based on the above-mentioned over-exposure image and the above-mentioned secondary exposure image after the over-exposure correction process is completed target image. Compared with the scheme of simply adjusting the exposure time in the prior art, in the scheme of the present application, the secondary exposure time corresponding to the current overexposed image is obtained, and after the secondary exposure image is obtained based on the secondary exposure time, the current overexposed image and the Obtained double exposure image Acquisition of a target image after overexposure correction processing is conducive to recording objects with large brightness differences in the same scene in the same target image, which is conducive to improving the quality of the obtained target image. Clearness, improve image recording effect.
具体的,本实施例中,如图2所示,上述步骤S100包括:Specifically, in this embodiment, as shown in FIG. 2, the above step S100 includes:
步骤S101,获取待处理图像。Step S101, acquiring an image to be processed.
步骤S102,基于上述过曝亮度阈值获取上述待处理图像中的过曝像素,其中,上述过曝像素的亮度值大于上述过曝亮度阈值。Step S102, acquiring overexposed pixels in the image to be processed based on the overexposure brightness threshold, where the brightness value of the overexposed pixels is greater than the overexposure brightness threshold.
步骤S103,当上述待处理图像中过曝像素的数量占比高于预设的过曝像素比例时,将上述待处理图像作为过曝图像。Step S103, when the ratio of the number of overexposed pixels in the image to be processed is higher than the preset proportion of overexposed pixels, the image to be processed is used as an overexposed image.
步骤S104,获取上述过曝图像中的人像目标区域。Step S104, acquiring the portrait target area in the above-mentioned overexposed image.
其中,上述待处理图像是需要进行图像处理的图像,上述待处理图像是通过摄像头对目标场景(如智能教室场景)下的目标对象进行拍摄获得的图像。待处理图像可能是存在过度曝光问题的图像,也有可能是不存在过度曝光的问题的图像,因此,本实施中,需要对待处理图像进行判断,判断其是否为过曝图像。具体的,本实施例中,首先通过摄像机自动曝光技术获取当前场景的第一张图像,即待处理图像,图像分辨率为X×Y,即上述待处理图像包括X×Y个像素。Wherein, the image to be processed is an image that requires image processing, and the image to be processed is an image obtained by shooting a target object in a target scene (such as a smart classroom scene) through a camera. The image to be processed may be an image with an overexposure problem, or an image without an overexposure problem. Therefore, in this implementation, it is necessary to determine whether the image to be processed is an overexposed image. Specifically, in this embodiment, the first image of the current scene, that is, the image to be processed, is first obtained through the camera automatic exposure technology, and the image resolution is X×Y, that is, the image to be processed includes X×Y pixels.
本实施例中,为了便于对图像的亮度进行分析,将上述待处理图像的色彩空间转换到HSL模型,其中L为亮度值。HSL模型中的L亮度值范围固定为0~1.0,与色深无关,适合用于进行本实施例中的曝光程度分析。In this embodiment, in order to analyze the brightness of the image, the color space of the image to be processed is transformed into an HSL model, where L is a brightness value. The L brightness value range in the HSL model is fixed at 0-1.0, regardless of the color depth, and is suitable for the exposure degree analysis in this embodiment.
本实施例中,预先设置上述过曝亮度阈值为0.9,对于待处理图像中的某一像素点,当其亮度值L超过0.9时,认为该像素过曝,作为过曝像素。遍历X×Y个像素,获取其中的所有过曝像素并累计其数量,计算过曝像素在上述待处理图像中所有像素中所占的比例(即数量占比),当过曝像素的数量占比高于预设的过曝像素比例时,将上述待处理图像作为过曝图像进行处理,反之则认为该待处理图像正常,无需进行处理,直接将该待处理图像作为目标图像。本实施例中,上述预设的过曝像素比例为10%,当过度曝光的像素超过待处理图像中总像素的10%时,认为该待处理图像有部分区域过曝,需要进行图像修正处理。In this embodiment, the above-mentioned overexposure brightness threshold is preset to be 0.9. For a certain pixel in the image to be processed, when its brightness value L exceeds 0.9, the pixel is considered to be overexposed and is regarded as an overexposed pixel. Traversing X×Y pixels, obtaining all the overexposed pixels and accumulating their number, calculating the proportion of overexposed pixels in all pixels in the image to be processed (ie, the proportion of the number), when the number of overexposed pixels accounts for When the ratio is higher than the preset overexposure pixel ratio, the image to be processed is processed as an overexposed image; otherwise, the image to be processed is considered normal and no processing is required, and the image to be processed is directly used as the target image. In this embodiment, the preset ratio of overexposed pixels is 10%. When the overexposed pixels exceed 10% of the total pixels in the image to be processed, it is considered that some areas of the image to be processed are overexposed, and image correction processing is required. .
具体的,本实施例中,如图3所示,上述步骤S104包括:Specifically, in this embodiment, as shown in FIG. 3, the above step S104 includes:
步骤S1041,对上述过曝图像进行人脸识别。Step S1041, perform face recognition on the above-mentioned overexposed image.
步骤S1042,将识别获得的各个人脸对应的区域分别作为上述人像目标区域。In step S1042, the regions corresponding to the recognized faces are respectively used as the above-mentioned target regions of the portrait.
目前的摄像头通常是以人脸为准调整自动曝光的,人脸区域对应的曝光通常是正常的,不会出现太强的过曝光情况,因此本实施例中通过人脸识别获取过曝图像中的人脸目标区域,以方便后续进行图像修正。具体的,上述人像目标区域包括教师对应的区域和学生对应的区域,设上述过曝图像中人像目标区域的总数为N,将N个人像目标区域中各像素对应的HSL模型中的亮度值L依次记录,获得队列ROI[N]。The current camera usually adjusts the automatic exposure based on the face. The exposure corresponding to the face area is usually normal, and there will not be too strong overexposure. Therefore, in this embodiment, the overexposure image obtained through face recognition face target area to facilitate subsequent image correction. Specifically, the above-mentioned portrait target area includes the area corresponding to the teacher and the area corresponding to the student, assuming that the total number of the portrait target area in the above-mentioned overexposed image is N, the brightness value L in the HSL model corresponding to each pixel in the N portrait target area Record sequentially to obtain the queue ROI[N].
具体的,本实施例中,上述步骤S200包括:对于每一个上述人像目标区域,计算上述人像目标区域内的有效像素的亮度值的均值,作为上述人像目标区域的像素有效亮度均值,其中,上述有效像素是亮度值不小于第一亮度阈值且不大于第二亮度阈值的像素,上述第一亮度阈值等于区域亮度均值减去区域标准差,上述第二亮度阈值等于区域亮度均值加上区域标准差,上述区域亮度均值和上述区域标准差分别是上述人像目标区域内所有像素的亮度值的均值和标准差。Specifically, in this embodiment, the above-mentioned step S200 includes: for each of the above-mentioned portrait target areas, calculating the average value of the brightness values of the effective pixels in the above-mentioned portrait target area, as the pixel effective brightness average value of the above-mentioned portrait target area, wherein the above-mentioned A valid pixel is a pixel whose luminance value is not less than the first luminance threshold and not greater than the second luminance threshold, the first luminance threshold is equal to the regional luminance mean minus the regional standard deviation, and the above second luminance threshold is equal to the regional luminance mean plus the regional standard deviation , the above-mentioned area brightness mean value and the above-mentioned area standard deviation are respectively the mean value and the standard deviation of the brightness values of all pixels in the above-mentioned portrait target area.
ROI队列中每个人像目标区域,大部分图像像素均为有效数据,但也包含少量过曝或过暗的背景或边缘像素,且每个人像目标区域内的亮度分布近似于正态分布。具体的,本实施例中,上述有效像素是亮度值在有效范围内(即第一亮度阈值和第二亮度阈值构成的范围内)的像素。具体的,对于每一个人像目标区域,获取该区域内的所有像素对应的亮度值,例如,本实施例中,将ROI队列中的队头数据进行处理,分别获取各个人像目标区域内所有像素的亮度值,对于每一个人像目标区域,可分别将其所有像素的亮度值构成亮度值数组ROI_L[n],其中,n代表该人像目标区域内的像素总数。In each portrait target area in the ROI queue, most of the image pixels are valid data, but also contain a small amount of overexposed or dark background or edge pixels, and the brightness distribution in each portrait target area is approximately normal distribution. Specifically, in this embodiment, the effective pixels are pixels whose luminance values are within an effective range (that is, within the range formed by the first luminance threshold and the second luminance threshold). Specifically, for each portrait target area, the brightness values corresponding to all the pixels in the area are obtained. For example, in this embodiment, the queue head data in the ROI queue are processed, and the brightness values of all pixels in each portrait target area are respectively obtained. For the brightness value, for each portrait target area, the brightness values of all its pixels can be respectively formed into a brightness value array ROI_L[n], where n represents the total number of pixels in the portrait target area.
本实施例中,分别将各人像目标区域内的所有像素对应的亮度值放入近似正态分布的模型中,具体的,对于各人像目标区域,分别将其亮度值数组ROI_L[n]中的所有元素放入近似正态分布的模型中。图4是本申请实施例提供的一个人像目标区域对应的亮度值分布 示意图,其中p为每个亮度值L的像素数量,μ是正态分布的均值,σ是正态分布的标准差。上述区域亮度均值即为正态分布的均值μ,上述区域标准差是正态分布的标准差σ。具体的,本实施例中,基于如下公式(1)和(2)计算获取均值μ和标准差σ:In this embodiment, the luminance values corresponding to all the pixels in each portrait target area are put into the model of approximately normal distribution, specifically, for each portrait target area, the luminance values in the luminance value array ROI_L[n] are respectively put into All elements were placed into a model with an approximately normal distribution. Fig. 4 is a schematic diagram of the brightness value distribution corresponding to a portrait target area provided by the embodiment of the present application, where p is the number of pixels of each brightness value L, μ is the mean value of the normal distribution, and σ is the standard deviation of the normal distribution. The mean value of the above-mentioned regional brightness is the mean value μ of the normal distribution, and the above-mentioned regional standard deviation is the standard deviation σ of the normal distribution. Specifically, in this embodiment, the mean value μ and standard deviation σ are calculated and obtained based on the following formulas (1) and (2):
Figure PCTCN2021139608-appb-000003
Figure PCTCN2021139608-appb-000003
Figure PCTCN2021139608-appb-000004
Figure PCTCN2021139608-appb-000004
其中,Lmax是当前人像目标区域内的亮度值的最大值,i代表当前亮度值,从0取到Lmax,代表遍历所有的亮度值取值,p(i)代表亮度值为i的像素的数目,n代表当前人像目标区域内的像素总数。j用于计数,j从1取到n,ROI_L(j)代表亮度值数组ROI_L中的第j个元素,本实施例中数组ROI_L的第1个元素为ROI_L(1),即从1开始计数。Among them, Lmax is the maximum value of the brightness value in the target area of the current portrait, i represents the current brightness value, from 0 to Lmax, represents the value of all brightness values traversed, p(i) represents the number of pixels with brightness value i , n represents the total number of pixels in the current portrait target area. j is used for counting, j is taken from 1 to n, ROI_L(j) represents the jth element in the brightness value array ROI_L, the first element of the array ROI_L in this embodiment is ROI_L(1), that is, counting starts from 1 .
本实施例中,第一亮度阈值为μ-σ,第二亮度阈值为μ+σ,当亮度值L在[μ-σ,μ+σ]内时该亮度值为有效亮度值,对应的像素为有效像素,不在该区间内的亮度值为干扰亮度值。本实施例中,仅使用有效亮度值计算各人像目标区域内的像素有效亮度均值,从而有利于提高计算精度,避免干扰亮度值的干扰,有利于获得各人像目标区域的显著亮度值。具体的,分别基于如下公式(3)计算各人像目标区域内的像素有效亮度均值:In this embodiment, the first brightness threshold is μ-σ, and the second brightness threshold is μ+σ. When the brightness value L is within [μ-σ, μ+σ], the brightness value is an effective brightness value, and the corresponding pixel It is an effective pixel, and the luminance value not in this interval is the interference luminance value. In this embodiment, only effective luminance values are used to calculate the average pixel effective luminance in each portrait target area, thereby improving calculation accuracy, avoiding interference from disturbing luminance values, and obtaining significant luminance values of each portrait target area. Specifically, calculate the average value of the pixel effective brightness in each portrait target area based on the following formula (3):
Figure PCTCN2021139608-appb-000005
Figure PCTCN2021139608-appb-000005
其中,A代表一个人像目标区域的像素有效亮度均值,i代表当前亮度值,p(i)代表亮度值为i的像素的数目,n代表当前人像目标区域内的像素总数。将所有人像目标区域的像素有效亮度均值组合构建一个包含N个元素的像素有效亮度均值数组L[N],其中,N为人像目标区域的总数。Among them, A represents the effective average brightness of pixels in a portrait target area, i represents the current brightness value, p(i) represents the number of pixels with brightness value i, and n represents the total number of pixels in the current portrait target area. Combining the average pixel effective luminance values of all portrait target areas to construct an array L[N] of effective pixel luminance average values containing N elements, where N is the total number of portrait target areas.
在一种应用场景中,可以将计算完毕的人像目标区域的亮度数据进行释放,并将队列ROI[N]中对应的队首移出队列,以节省存储空间。同时,也可以根据队列ROI[N]判断是否将所有的人像目标区域都计算完毕,当内存中队列ROI[N]为空时,认为获取到所有人像目标区域对应的像素有效亮度均值数组L[N]。In an application scenario, the calculated luminance data of the portrait target area may be released, and the corresponding head of the queue ROI[N] may be removed from the queue to save storage space. At the same time, it can also be judged according to the queue ROI[N] whether all the portrait target areas have been calculated. When the queue ROI[N] in the memory is empty, it is considered that the pixel effective brightness mean array L[ N].
具体的,本实施例中,如图5所示,上述步骤S300包括:Specifically, in this embodiment, as shown in FIG. 5, the above step S300 includes:
步骤S301,计算所有上述人像目标区域的像素有效亮度均值的均值,作为图像有效亮度均值。Step S301 , calculating the mean value of the average pixel effective brightness of all the above-mentioned portrait target areas, as the average effective brightness of the image.
步骤S302,计算获取二次曝光时间,其中,上述二次曝光时间等于上述图像有效亮度均值与上述当前曝光时间的乘积除以上述过曝亮度阈值。Step S302, calculating and obtaining a secondary exposure time, wherein the secondary exposure time is equal to the product of the effective image brightness average and the current exposure time divided by the over-exposure brightness threshold.
具体的,计算所有N个人像目标区域对应的像素有效亮度均值的均值,作为图像有效亮度均值L',在一种应用场景中,基于如下公式(4)计算图像有效亮度均值:Specifically, calculate the mean value of the pixel effective luminance mean value corresponding to all N portrait target areas, as the image effective luminance mean value L', in an application scenario, calculate the image effective luminance mean value based on the following formula (4):
Figure PCTCN2021139608-appb-000006
Figure PCTCN2021139608-appb-000006
其中,k用于计数,k从1取到N,L(k)代表像素有效亮度均值数组的第k个元素,像素有效亮度均值数组的第1个元素为L(1),即从1开始计数,N代表人像目标区域的总数。获得上述图像有效亮度均值L'后,基于图像亮度与曝光时间之间的关系
Figure PCTCN2021139608-appb-000007
可以计算出合适的二次曝光时间:
Among them, k is used for counting, k is taken from 1 to N, L(k) represents the kth element of the pixel effective brightness mean array, and the first element of the pixel effective brightness mean value array is L(1), that is, starting from 1 Count, N represents the total number of portrait object regions. After obtaining the average value L' of the effective brightness of the above image, based on the relationship between the brightness of the image and the exposure time
Figure PCTCN2021139608-appb-000007
A suitable secondary exposure time can be calculated:
Figure PCTCN2021139608-appb-000008
Figure PCTCN2021139608-appb-000008
其中,T'为二次曝光时间,T为当前曝光时间,L 1为过曝亮度阈值,本实施例中,过曝亮度阈值设置为0.9。 Wherein, T′ is the second exposure time, T is the current exposure time, L 1 is the overexposure brightness threshold, and in this embodiment, the overexposure brightness threshold is set to 0.9.
具体的,本实施例中,如图6所示,上述步骤S400包括:Specifically, in this embodiment, as shown in FIG. 6, the above step S400 includes:
步骤S401,基于上述二次曝光时间进行拍摄,获取二次曝光图像。Step S401, shooting based on the above-mentioned secondary exposure time, and acquiring a secondary exposure image.
步骤S402,基于上述二次曝光图像对上述过曝图像进行修正,获取目标图像。Step S402, correcting the above-mentioned over-exposed image based on the above-mentioned double-exposure image, and acquiring a target image.
具体的,基于上述计算获得的二次曝光时间控制摄像头对当前场景进行第二次拍摄,以使得部分过度曝光的区域能在二次曝光图像中清楚显示。进一步的,将上述过曝图像中的过曝像素替换为上述二次曝光图像中的相应像素,获得目标图像,其中,上述过曝像素的亮度值大于上述过曝亮度阈值。本实施例中,将上述过曝图像中亮度值大于0.9的像素替换为二次曝光图像中的相应像素,可以获得图像修正后的正确图像(即目标图像),作为视频中一帧图像的修正。需要说明的是,本实施例方法的时间复杂度为O(X×Y),可以满足实时处理要求,在完成一帧图像的修正后,可以继续处理下一帧的图像,其中,X×Y为过曝图像的图像分辨率。Specifically, the camera is controlled to take a second shot of the current scene based on the second exposure time obtained by the above calculation, so that a partially overexposed area can be clearly displayed in the second exposure image. Further, the target image is obtained by replacing the overexposed pixels in the overexposed image with corresponding pixels in the double exposure image, wherein the brightness value of the overexposed pixel is greater than the overexposed brightness threshold. In this embodiment, by replacing the pixels with brightness values greater than 0.9 in the above-mentioned overexposed image with the corresponding pixels in the double-exposure image, the correct image after image correction (i.e. the target image) can be obtained as the correction of a frame of image in the video . It should be noted that the time complexity of the method in this embodiment is O(X×Y), which can meet the requirements of real-time processing. After the correction of one frame of image is completed, the next frame of image can be processed, where X×Y is the image resolution of the overexposed image.
本实施例中,还基于一种具体应用场景对上述图像处理方法进行具体说明,图7是本申请实施例提供的一种图像处理方法的具体流程示意图。如图7所示,在获取自动曝光图像(即待处理图像)后,转换色彩空间,判断该自动曝光图像是否过度曝光(q%是否大于10%,q%为过度曝光的像素所占的比例)。当该自动曝光图像过度曝光时,基于如图7所示的具体流程进行处理,获得二次曝光时间,进而获得二次曝光图像,基于二次曝光图像对当前图像进行修正,从而获得正确图像(即目标图像)。现有技术中,通过场景亮度分析,不停调整曝光时间来获得场景信息,但是对于同一场景存在亮度差异显著的物体时,这种曝光方式并不能同时将亮度存在差异的物体拍摄到同一画面中。对于使用卷积法进行 图像修复的技术,多次卷积将实际到更频繁的曝光,只能应用于静态场景的图像修复。而本实施例中的图像处理方法通过HSL模型对画面进行亮度分析,算法时间复杂度为O(X×Y),可以在不可察觉的时间延迟下完成分析工作,这种低延迟的算法能满足动态场景的实时图像修复。In this embodiment, the above image processing method is also specifically described based on a specific application scenario. FIG. 7 is a schematic flowchart of an image processing method provided in an embodiment of the present application. As shown in Figure 7, after acquiring the auto-exposure image (that is, the image to be processed), the color space is converted to determine whether the auto-exposure image is overexposed (whether q% is greater than 10%, and q% is the proportion of overexposed pixels ). When the automatic exposure image is overexposed, the process is performed based on the specific process shown in Figure 7 to obtain the second exposure time, and then the second exposure image is obtained, and the current image is corrected based on the second exposure image, thereby obtaining the correct image ( i.e. the target image). In the prior art, the scene information is obtained by continuously adjusting the exposure time through scene brightness analysis, but when there are objects with significant brightness differences in the same scene, this exposure method cannot capture objects with different brightness in the same frame at the same time . For image inpainting techniques using convolution methods, multiple convolutions will actually result in more frequent exposures, which can only be applied to image inpainting of static scenes. However, the image processing method in this embodiment uses the HSL model to analyze the brightness of the picture. The time complexity of the algorithm is O(X×Y), and the analysis work can be completed with imperceptible time delay. This low-delay algorithm can satisfy Real-time image inpainting for dynamic scenes.
智慧教室中的摄像机使用目的与其他领域摄像机的使用目的不同,相比于视频的流畅性和色彩的还原度,更强调信息记录性。本实施例提出的图像处理方法降低帧率,基于人脸识别的技术获取显著曝光值(即有效亮度值),同时将整个画面信息转为HSL数学模型以方便对于图像各部分亮度的分析,在分析图像过曝区域亮度值后,以第二次低曝光时间的手段来获取场景内局部过曝拍摄物体的信息,最后将两张图像拼合在一起,实现将同一场景不同亮度拍摄物体记录在同一画面上。需要说明的是,上述图像处理方法还可以用于其它带有显示器的摄像机拍摄场景,如智能会议场景等,可以通过上述图像处理方法解决场景中使用显示器过亮,无法拍摄到显示器上的信息的问题。The purpose of using cameras in smart classrooms is different from that of cameras in other fields. Compared with the smoothness of video and the degree of color restoration, information recording is more emphasized. The image processing method proposed in this embodiment reduces the frame rate, obtains significant exposure values (i.e., effective brightness values) based on face recognition technology, and simultaneously converts the entire picture information into an HSL mathematical model to facilitate the analysis of the brightness of each part of the image. After analyzing the brightness value of the over-exposed area of the image, the information of the partially over-exposed object in the scene is obtained by means of the second low exposure time, and finally the two images are stitched together to record the object with different brightness in the same scene. on screen. It should be noted that the above image processing method can also be used in other camera shooting scenes with a display, such as smart conference scenes, etc., and the above image processing method can be used to solve the problem that the display is too bright in the scene and the information on the display cannot be captured. question.
实施例2Example 2
如图8中所示,对应于上述图像处理方法,本申请实施例还提供一种图像处理装置,上述图像处理装置包括:As shown in FIG. 8, corresponding to the above image processing method, an embodiment of the present application further provides an image processing device, and the above image processing device includes:
过曝图像获取模块510,用于获取过曝图像,并获取上述过曝图像中的人像目标区域。The overexposure image acquisition module 510 is configured to acquire the overexposure image, and acquire the portrait target area in the overexposure image.
其中,上述过曝图像是对目标对象拍摄获得的存在部分区域过度曝光的图像,目标对象是需要通过图像进行记录的对象。本实施例中,以智慧教室的应用场景为例进行说明,则目标对象包括教室内的师生以及显示屏,还可以包括黑板等包含教学信息的区域。在其它应用场景中,目标对象还可以为其它对象,例如智能会议场景下目标对象可以包括与会人员和会议播放显示屏,在此不做具体限定。Wherein, the above-mentioned overexposed image is an image obtained by photographing a target object with partial area overexposure, and the target object is an object that needs to be recorded through the image. In this embodiment, the application scenario of a smart classroom is taken as an example for illustration, and the target objects include teachers and students in the classroom and display screens, and may also include areas containing teaching information such as blackboards. In other application scenarios, the target object may also be other objects. For example, in a smart conference scenario, the target object may include participants and a conference playback display screen, which is not specifically limited here.
上述人像目标区域是过曝图像中人脸对应的区域。目前的摄像头通常是以人脸为准调整自动曝光的,人脸区域对应的曝光通常是正常的,不会出现太强的过曝光情况,因此获取过曝图像中的人像目标区域有助于快速获取过曝图像中亮度正常的像素点,从而便于获知过曝图像的过曝程度,进而便于调整二次曝光时间,对过曝光区域进行补偿修正。本实施例中,在智慧教室的应用场景下,过曝图像中人脸包括老师的人脸和学生的人脸。The aforementioned portrait target area is an area corresponding to a human face in the overexposed image. The current camera usually adjusts the automatic exposure based on the face. The exposure corresponding to the face area is usually normal, and there will not be too strong overexposure. Therefore, obtaining the target area of the portrait in the overexposed image is helpful to quickly Pixels with normal brightness in the over-exposed image are obtained, so as to facilitate knowing the degree of over-exposure of the over-exposed image, thereby facilitating adjustment of the secondary exposure time, and compensation and correction of the over-exposed area. In this embodiment, in the application scenario of the smart classroom, the faces in the overexposed image include the faces of the teacher and the faces of the students.
均值获取模块520,用于分别获取各上述人像目标区域的像素有效亮度均值。The mean value acquisition module 520 is configured to respectively acquire the mean value of the pixel effective brightness of each of the above-mentioned portrait target areas.
其中,一个人像目标区域对应一个像素有效亮度均值,像素有效亮度均值是对应的人像目标区域内的所有有效像素的亮度值的均值,其中,有效像素是不过暗也不过亮的像素。例如,在一种应用场景中,有效像素是对应的人像目标区域内亮度值在预设范围内的像素。本实施例中,分别计算获取每一个人像目标区域对应的像素有效亮度均值。Wherein, a portrait target area corresponds to a pixel effective mean brightness, which is the mean value of the brightness values of all effective pixels in the corresponding portrait target area, wherein an effective pixel is a pixel that is neither too dark nor too bright. For example, in an application scenario, valid pixels are pixels whose luminance values are within a preset range in the corresponding portrait target area. In this embodiment, the average pixel effective brightness corresponding to each portrait target area is calculated and acquired respectively.
二次曝光时间获取模块530,用于基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间。The second exposure time acquiring module 530 is configured to calculate and acquire the second exposure time based on the current exposure time, the overexposure brightness threshold and the above-mentioned pixel effective brightness average.
具体的,曝光时间是为了将光投射到照相感光材料的感光面上,快门所要打开的时间。其中,上述当前曝光时间是当前的过曝图像对应的曝光时间,即上述过曝图像是基于当前曝光时间拍摄获得的图像。过曝亮度阈值是预先设置的亮度阈值,考虑过度曝光的情况,当某一像素点对应的亮度值超过上述过曝亮度阈值时,认为该点过度曝光。上述过曝亮度阈值可以根据实际需求进行设置和调整。在一种应用场景中,可以直接减小当前曝光时间后作为二次曝光时间,从而以第二次低曝光时间的手段来获取场景内局部过曝的物体的信息。在本实施例中,基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值对二次曝光时间进行准确地计算,以保证能充分获取到场景内局部过曝的物体的信息,同时减小所需要的等待和计算时间,提高实时性,满足课堂的实时性需求。Specifically, the exposure time is the time for the shutter to be opened in order to project light onto the photosensitive surface of the photographic photosensitive material. Wherein, the above-mentioned current exposure time is the exposure time corresponding to the current over-exposed image, that is, the above-mentioned over-exposed image is an image obtained by shooting based on the current exposure time. The overexposure brightness threshold is a preset brightness threshold. Considering the situation of overexposure, when the brightness value corresponding to a certain pixel exceeds the above-mentioned overexposure brightness threshold, it is considered that the point is overexposed. The above-mentioned overexposure brightness threshold may be set and adjusted according to actual needs. In one application scenario, the current exposure time can be directly reduced as the second exposure time, so as to acquire information of partially overexposed objects in the scene by means of the second lower exposure time. In this embodiment, the secondary exposure time is accurately calculated based on the current exposure time, the overexposure brightness threshold, and the above average pixel effective brightness, so as to ensure that the information of locally overexposed objects in the scene can be fully obtained, and at the same time reduce The required waiting and calculation time can improve real-time performance and meet the real-time performance requirements of the classroom.
处理模块540,用于基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取处理后的目标图像。The processing module 540 is configured to acquire a secondary exposure image based on the secondary exposure time, and acquire a processed target image based on the overexposed image and the secondary exposure image.
具体的,获得二次曝光时间后,基于二次曝光时间获取二次曝光图像。二次曝光时间是根据当前的过曝图像的亮度值情况进行计算获得的,可以保证获得的二次曝光图像中,与当前过曝图像中过度曝光的区域对应的区域是正常的(不过度曝光的),从而可以结合过曝图像和二次曝光图像获取一张完成过曝修正的更为清楚的目标图像。在上述目标图像中,当前场景下的各个目标对象(包括师生人脸和显示屏显示的内容)都清晰可见,不会因为过度曝光而导致部分内容看不清楚。Specifically, after the second exposure time is obtained, the second exposure image is acquired based on the second exposure time. The secondary exposure time is calculated according to the brightness value of the current overexposed image, which can ensure that in the obtained secondary exposure image, the area corresponding to the overexposed area in the current overexposed image is normal (not overexposed ), so that the over-exposure image and the double-exposure image can be combined to obtain a clearer target image that has completed the over-exposure correction. In the above target image, all target objects in the current scene (including the faces of teachers and students and the content displayed on the display screen) are clearly visible, and some content will not be unclear due to overexposure.
由上可见,本申请实施例提供的图像处理装置通过过曝图像获取模块510获取过曝图像,并获取上述过曝图像中的人像目标区域;通过均值获取模块520分别获取各上述人像目标区域的像素有效亮度均值;通过二次曝光时间获取模块530基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间;通过处理模块540基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取处理后的目标图像。与现有技术中单纯调整曝光时间的方案相比,本申请方案中,获取当前过曝图像对应的二次曝光时间,基于二次曝光时间获取二次曝光图像后,结合当前的过曝图像和获得的二次曝光图像获取一张完成过曝修正处理后的目标图像,有利于将同一场景下亮度差异较大的拍摄对象都良好地记录在同一目标图像中,有利于提升获得的目标图像的清楚程度,提升图像记录效果。It can be seen from the above that the image processing device provided in the embodiment of the present application acquires the overexposed image through the overexposed image acquisition module 510, and acquires the target area of the portrait in the above-mentioned overexposed image; the average value acquisition module 520 respectively acquires the values of the target areas of the above-mentioned portraits. Pixel effective luminance mean value; the second exposure time is obtained by calculating and obtaining the second exposure time based on the current exposure time, the overexposure brightness threshold and the above-mentioned pixel effective luminance mean value through the second exposure time acquisition module 530; the second exposure image is obtained based on the above-mentioned second exposure time through the processing module 540 , and acquire a processed target image based on the above-mentioned over-exposure image and the above-mentioned double-exposure image. Compared with the scheme of simply adjusting the exposure time in the prior art, in the scheme of the present application, the secondary exposure time corresponding to the current overexposed image is obtained, and after the secondary exposure image is obtained based on the secondary exposure time, the current overexposed image and the Obtained double exposure image Acquisition of a target image after overexposure correction processing is conducive to recording objects with large brightness differences in the same scene in the same target image, which is conducive to improving the quality of the obtained target image. Clearness, improve image recording effect.
具体的,本实施例中,上述图像处理装置及其各模块的具体功能可以参照上述图像处理方法中的对应描述,在此不再赘述。Specifically, in this embodiment, for the specific functions of the image processing apparatus and its modules, reference may be made to the corresponding description in the above image processing method, which will not be repeated here.
实施例3Example 3
基于上述实施例,本申请还提供了一种智能终端,其原理框图可以如图9所示。上述智能终端包括通过系统总线连接的处理器、存储器、网络接口以及显示屏。其中,该智能终端的处理器用于提供计算和控制能力。该智能终端的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和图像处理程序。该内存储器为非易失性存储介质中的操作系统和图像处理程序的运行提供环境。该智能终端的网络接口用于与外部的终端通过网络连接通信。该图像处理程序被处理器执行时实现上述任意一种图像处理方法的步骤。该智能终端的显示屏可以是液晶显示屏或者电子墨水显示屏。Based on the foregoing embodiments, the present application also provides an intelligent terminal, the functional block diagram of which may be shown in FIG. 9 . The above intelligent terminal includes a processor, a memory, a network interface and a display screen connected through a system bus. Wherein, the processor of the smart terminal is used to provide calculation and control capabilities. The memory of the smart terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and an image processing program. The internal memory provides an environment for the operation of the operating system and the image processing program in the non-volatile storage medium. The network interface of the smart terminal is used to communicate with external terminals through a network connection. When the image processing program is executed by the processor, the steps of any one of the above image processing methods are implemented. The display screen of the smart terminal may be a liquid crystal display screen or an electronic ink display screen.
本领域技术人员可以理解,图9中示出的原理框图,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的智能终端的限定,具体的智能终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the functional block diagram shown in Figure 9 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the smart terminal to which the solution of this application is applied. The specific smart terminal More or fewer components than shown in the figures may be included, or certain components may be combined, or have a different arrangement of components.
在一个实施例中,提供了一种智能终端,上述智能终端包括存储器、处理器以及存储在上述存储器上并可在上述处理器上运行的图像处理程序,上述图像处理程序被上述处理器执行时进行以下操作指令:In one embodiment, an intelligent terminal is provided. The above-mentioned intelligent terminal includes a memory, a processor, and an image processing program stored on the above-mentioned memory and operable on the above-mentioned processor. When the above-mentioned image processing program is executed by the above-mentioned processor Carry out the following operation instructions:
获取过曝图像,并获取上述过曝图像中的人像目标区域;Obtain an overexposed image, and obtain the portrait target area in the above overexposed image;
分别获取各上述人像目标区域的像素有效亮度均值;Respectively obtain the pixel effective luminance mean value of each of the above-mentioned portrait target areas;
基于当前曝光时间、过曝亮度阈值以及上述像素有效亮度均值计算获取二次曝光时间;Calculate and obtain the secondary exposure time based on the current exposure time, the overexposure brightness threshold and the average value of the effective brightness of the above-mentioned pixels;
基于上述二次曝光时间获取二次曝光图像,并基于上述过曝图像和上述二次曝光图像获取一张完成过曝修正处理后的目标图像。A secondary exposure image is acquired based on the secondary exposure time, and a target image after overexposure correction processing is acquired based on the overexposure image and the secondary exposure image.
实施例4Example 4
本申请实施例还提供一种计算机可读存储介质,上述计算机可读存储介质上存储有图像处理程序,上述图像处理程序被处理器执行时实现本申请实施例提供的任意一种图像处理方法的步骤。An embodiment of the present application also provides a computer-readable storage medium, where an image processing program is stored on the above-mentioned computer-readable storage medium, and when the above-mentioned image processing program is executed by a processor, any image processing method provided by the embodiment of the present application is implemented. step.
应理解,上述实施例中各步骤的序号大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将上述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能 单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned functions can be assigned to different functional units, Module completion means that the internal structure of the above-mentioned device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit, and the above-mentioned integrated units may adopt hardware It can also be implemented in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the above system, reference may be made to the corresponding process in the foregoing method embodiments, and details will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各实例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟是以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality in different ways for each particular application, but such implementation should not be considered beyond the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,上述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以由另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the embodiments provided in this application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the device/terminal device embodiments described above are only illustrative. For example, the division of the above-mentioned modules or units is only a logical function division. In actual implementation, other division methods may be used, such as multiple units or Components may be combined or integrated into another system, or some features may be omitted, or not implemented.
上述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,上述计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,上述计算机程序包括计算机程序代码,上述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。上述计算机可读介质可以包括:能够携带上述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,上述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减。If the above-mentioned integrated modules/units are realized in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing related hardware through computer programs. The above computer programs can be stored in a computer-readable storage medium. When executed by the processor, the steps in the above-mentioned various method embodiments can be realized. Wherein, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code may be in the form of source code, object code, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random Access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the above computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解;其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不是相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand; Modifications to the technical solutions described in the examples, or equivalent replacement of some of the technical features; and these modifications or replacements do not mean that the essence of the corresponding technical solutions deviates from the spirit and scope of the technical solutions of the various embodiments of the application, and should be included in this application. within the scope of the application.
工业实用性Industrial Applicability
本申请实施例提供的图像处理方法、装置及计算机可读存储介质,获取当前过曝图像对应的二次曝光时间,基于二次曝光时间获取二次曝光图像后,结合当前的过曝图像和获得的二次曝光图像获取一张完成过曝修正处理后的目标图像,实现了对过曝图像的修正处理,从而能够实现将同一场景下亮度差异较大的拍摄对象都良好地记录在同一目标图像中,在实际效果上对于图像的清晰程度得到了明显改善,提升了图像记录效果。The image processing method, device, and computer-readable storage medium provided in the embodiments of the present application acquire the secondary exposure time corresponding to the current overexposed image, and after acquiring the secondary exposure image based on the secondary exposure time, combine the current overexposed image and the obtained Obtain a target image after the over-exposure correction processing of the double-exposure image, and realize the correction processing of the over-exposure image, so that the subjects with large brightness differences in the same scene can be well recorded in the same target image In the actual effect, the clarity of the image has been significantly improved, and the image recording effect has been improved.

Claims (15)

  1. 一种图像处理方法,其中,所述方法包括:An image processing method, wherein the method includes:
    获取过曝图像,并获取所述过曝图像中的人像目标区域;Obtain an overexposed image, and obtain a portrait target area in the overexposed image;
    分别获取各所述人像目标区域的像素有效亮度均值;Respectively obtain the average pixel effective brightness of each of the portrait target areas;
    基于当前曝光时间、过曝亮度阈值以及所述像素有效亮度均值计算获取二次曝光时间;calculating and obtaining a second exposure time based on the current exposure time, the overexposure brightness threshold and the average value of the effective brightness of the pixel;
    基于所述二次曝光时间获取二次曝光图像,并基于所述过曝图像和所述二次曝光图像获取一张完成过曝修正处理后的目标图像。A secondary exposure image is acquired based on the secondary exposure time, and a target image after overexposure correction processing is acquired based on the overexposure image and the secondary exposure image.
  2. 根据权利要求1所述的图像处理方法,其中,所述获取过曝图像,并获取所述过曝图像中的人像目标区域,包括:The image processing method according to claim 1, wherein said acquiring the overexposed image, and acquiring the portrait target area in the overexposed image comprises:
    获取待处理图像;Get the image to be processed;
    基于所述过曝亮度阈值获取所述待处理图像中的过曝像素,其中,所述过曝像素的亮度值大于所述过曝亮度阈值;Acquiring an overexposed pixel in the image to be processed based on the overexposure brightness threshold, wherein the brightness value of the overexposed pixel is greater than the overexposure brightness threshold;
    当所述待处理图像中过曝像素的数量占比高于预设的过曝像素比例时,将所述待处理图像作为过曝图像;When the ratio of the number of overexposed pixels in the image to be processed is higher than a preset ratio of overexposed pixels, the image to be processed is used as an overexposed image;
    获取所述过曝图像中的人像目标区域。Acquiring a portrait target area in the overexposed image.
  3. 根据权利要求2所述的图像处理方法,其中,所述获取待处理图像,包括:通过摄像机自动曝光技术获取所述待处理图像。The image processing method according to claim 2, wherein said acquiring the image to be processed comprises: acquiring the image to be processed by a camera automatic exposure technique.
  4. 根据权利要求2所述的图像处理方法,其中,所述基于所述过曝亮度阈值获取所述待处理图像中的过曝像素,包括:The image processing method according to claim 2, wherein said acquiring overexposed pixels in said image to be processed based on said overexposure brightness threshold comprises:
    将所述待处理图像的色彩空间转换到HSL模型中,将转换后的所述待处理图像中亮度值大于所述过曝亮度阈值的像素作为所述过曝像素。Converting the color space of the image to be processed into an HSL model, and using pixels whose luminance values are greater than the overexposed luminance threshold in the converted image to be processed as the overexposed pixels.
  5. 根据权利要求4所述的图像处理方法,其中,所述过曝亮度阈值为0.9。The image processing method according to claim 4, wherein the overexposure brightness threshold is 0.9.
  6. 根据权利要求2所述的图像处理方法,其中,所述获取所述过曝图像中的人像目标区域,包括:The image processing method according to claim 2, wherein said obtaining the portrait target area in the overexposed image comprises:
    对所述过曝图像进行人脸识别;Perform face recognition on the overexposed image;
    将识别获得的各个人脸对应的区域分别作为所述人像目标区域。The regions corresponding to the recognized faces are respectively used as the portrait target regions.
  7. 根据权利要求1所述的图像处理方法,其中,所述分别获取各所述人像目标区域的像素有效亮度均值,包括:The image processing method according to claim 1, wherein said obtaining the pixel effective brightness mean value of each said portrait target area respectively comprises:
    对于每一个所述人像目标区域,计算所述人像目标区域内的有效像素的亮度值的均值,作为所述人像目标区域的像素有效亮度均值,其中,所述有效像素是亮度值不小于第一亮度阈值且不大于第二亮度阈值的像素,所述第一亮度阈值等于区域亮度均值减去区域标准差,所述第二亮度阈值等于区域亮度均值加上区域标准差,所述区域亮度均值和所述区域 标准差分别是所述人像目标区域内所有像素的亮度值的均值和标准差。For each of the portrait target areas, calculate the mean value of the brightness values of the effective pixels in the portrait target area as the pixel effective brightness mean value of the portrait target area, wherein the effective pixels have a brightness value not less than the first A pixel whose brightness threshold is not greater than the second brightness threshold, the first brightness threshold is equal to the regional brightness mean minus the regional standard deviation, the second brightness threshold is equal to the regional brightness mean plus the regional standard deviation, the regional brightness mean and The regional standard deviations are respectively the mean value and standard deviation of brightness values of all pixels in the portrait target area.
  8. 根据权利要求2所述的图像处理方法,其中,所述基于当前曝光时间、过曝亮度阈值以及所述像素有效亮度均值计算获取二次曝光时间,包括:The image processing method according to claim 2, wherein said calculating and obtaining the secondary exposure time based on the current exposure time, the overexposure brightness threshold and the average value of the pixel effective brightness comprises:
    计算所有所述人像目标区域的像素有效亮度均值的均值,作为图像有效亮度均值;Calculate the mean value of the pixel effective brightness mean value of all the portrait target regions as the image effective brightness mean value;
    计算获取二次曝光时间,其中,所述二次曝光时间等于所述图像有效亮度均值与所述当前曝光时间的乘积除以所述过曝亮度阈值。Calculate and obtain a secondary exposure time, wherein the secondary exposure time is equal to the product of the effective image brightness average value and the current exposure time divided by the overexposure brightness threshold.
  9. 根据权利要求8所述的图像处理方法,其中,所述计算所有所述人像目标区域的像素有效亮度均值的均值,作为图像有效亮度均值,包括:The image processing method according to claim 8, wherein the calculation of the mean value of the pixel effective brightness mean value of all the portrait target regions, as the image effective brightness mean value, includes:
    计算
    Figure PCTCN2021139608-appb-100001
    其中,k为1到N之间的正整数,L(k)代表像素有效亮度均值数组的第k个元素,N代表所述人像目标区域的总数,L'代表所述图像有效亮度均值,所述像素有效亮度均值数组是所有所述人像目标区域的像素有效亮度均值组成的数组。
    calculate
    Figure PCTCN2021139608-appb-100001
    Wherein, k is a positive integer between 1 and N, L(k) represents the kth element of the array of pixel effective brightness averages, N represents the total number of the portrait target area, and L' represents the effective brightness average value of the image, so The pixel effective brightness mean value array is an array composed of pixel effective brightness mean values of all the portrait target regions.
  10. 根据权利要求9所述的图像处理方法,其中,所述计算获取二次曝光时间,包括:The image processing method according to claim 9, wherein said calculating and obtaining the secondary exposure time comprises:
    计算
    Figure PCTCN2021139608-appb-100002
    其中,T'为所述二次曝光时间,T为所述待处理图像对应的当前曝光时间,L 1为所述过曝亮度阈值,L'为所述图像有效亮度均值。
    calculate
    Figure PCTCN2021139608-appb-100002
    Wherein, T' is the secondary exposure time, T is the current exposure time corresponding to the image to be processed, L 1 is the overexposure brightness threshold, and L' is the effective average brightness of the image.
  11. 根据权利要求1所述的图像处理方法,其中,所述基于所述二次曝光时间获取二次曝光图像,并基于所述过曝图像和所述二次曝光图像获取一张完成过曝修正处理后的目标图像,包括:The image processing method according to claim 1, wherein the second exposure image is acquired based on the second exposure time, and an overexposure correction process is completed based on the overexposure image and the second exposure image acquisition After the target image, include:
    基于所述二次曝光时间进行拍摄,获取二次曝光图像;Taking pictures based on the secondary exposure time to obtain a secondary exposure image;
    基于所述二次曝光图像对所述过曝图像进行修正,获取目标图像。Correcting the overexposed image based on the double exposure image to acquire a target image.
  12. 根据权利要求11所述的图像处理方法,其中,所述基于所述二次曝光时间进行拍摄,获取二次曝光图像,包括:The image processing method according to claim 11, wherein said taking pictures based on said secondary exposure time and obtaining a secondary exposure image comprises:
    基于所述二次曝光时间控制摄像机进行拍摄,将拍摄获得的图像作为所述二次曝光图像。The camera is controlled to shoot based on the secondary exposure time, and the image obtained by shooting is used as the secondary exposure image.
  13. 根据权利要求11所述的图像处理方法,其中,所述基于所述二次曝光图像对所述过曝图像进行修正,获取目标图像,包括:The image processing method according to claim 11, wherein said correcting said overexposed image based on said secondary exposure image to acquire a target image comprises:
    将所述过曝图像中的过曝像素替换为所述二次曝光图像中的相应像素,获得目标图像,其中,所述过曝像素的亮度值大于所述过曝亮度阈值。A target image is obtained by replacing overexposed pixels in the overexposed image with corresponding pixels in the double-exposure image, wherein the luminance value of the overexposed pixel is greater than the overexposed luminance threshold.
  14. 一种图像处理装置,其中,所述装置包括:An image processing device, wherein the device includes:
    过曝图像获取模块,用于获取过曝图像,并获取所述过曝图像中的人像目标区域;An overexposed image acquisition module, configured to acquire an overexposed image, and acquire a portrait target area in the overexposed image;
    均值获取模块,用于分别获取各所述人像目标区域的像素有效亮度均值;Mean value acquisition module, used to respectively obtain the pixel effective brightness mean value of each described portrait target area;
    二次曝光时间获取模块,用于基于当前曝光时间、过曝亮度阈值以及所述像素有效亮度均值计算获取二次曝光时间;A secondary exposure time acquisition module, configured to calculate and obtain a secondary exposure time based on the current exposure time, the overexposure brightness threshold, and the average value of the effective brightness of the pixel;
    处理模块,用于基于所述二次曝光时间获取二次曝光图像,并基于所述过曝图像和所述二次曝光图像获取处理后的目标图像。A processing module, configured to acquire a secondary exposure image based on the secondary exposure time, and acquire a processed target image based on the overexposed image and the secondary exposure image.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有图像处理程序,所述图像处理程序被处理器执行时实现如权利要求1-13任意一项所述图像处理方法的步骤。A computer-readable storage medium, wherein an image processing program is stored on the computer-readable storage medium, and when the image processing program is executed by a processor, the image processing method according to any one of claims 1-13 is implemented step.
PCT/CN2021/139608 2021-10-12 2021-12-20 Image processing method and apparatus, and computer-readable storage medium WO2023060762A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111186817.9A CN114007020B (en) 2021-10-12 2021-10-12 Image processing method and device, intelligent terminal and computer readable storage medium
CN202111186817.9 2021-10-12

Publications (1)

Publication Number Publication Date
WO2023060762A1 true WO2023060762A1 (en) 2023-04-20

Family

ID=79922615

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/139608 WO2023060762A1 (en) 2021-10-12 2021-12-20 Image processing method and apparatus, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN114007020B (en)
WO (1) WO2023060762A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116962890A (en) * 2023-09-21 2023-10-27 卡奥斯工业智能研究院(青岛)有限公司 Processing method, device, equipment and storage medium of point cloud image

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992863B (en) * 2021-12-28 2022-05-31 合肥的卢深视科技有限公司 Automatic exposure method, device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160127655A1 (en) * 2014-10-30 2016-05-05 Hisense Mobile Communications Technology Co., Ltd. Method and device for image taking brightness control and computer readable storage medium
CN110731078A (en) * 2019-09-10 2020-01-24 深圳市汇顶科技股份有限公司 Exposure time calculation method, device and storage medium
CN111432134A (en) * 2020-03-17 2020-07-17 广东博智林机器人有限公司 Method and device for determining exposure time of image acquisition equipment and processor
CN111586308A (en) * 2020-04-10 2020-08-25 北京迈格威科技有限公司 Image processing method and device and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523386B (en) * 2011-12-16 2014-01-29 中国科学院西安光学精密机械研究所 Automatic exposure method based on histogram equalization
CN108616689B (en) * 2018-04-12 2020-10-02 Oppo广东移动通信有限公司 Portrait-based high dynamic range image acquisition method, device and equipment
CN111242086A (en) * 2020-01-21 2020-06-05 成都国翼电子技术有限公司 Image exposure adjusting method based on face recognition

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160127655A1 (en) * 2014-10-30 2016-05-05 Hisense Mobile Communications Technology Co., Ltd. Method and device for image taking brightness control and computer readable storage medium
CN110731078A (en) * 2019-09-10 2020-01-24 深圳市汇顶科技股份有限公司 Exposure time calculation method, device and storage medium
CN111432134A (en) * 2020-03-17 2020-07-17 广东博智林机器人有限公司 Method and device for determining exposure time of image acquisition equipment and processor
CN111586308A (en) * 2020-04-10 2020-08-25 北京迈格威科技有限公司 Image processing method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116962890A (en) * 2023-09-21 2023-10-27 卡奥斯工业智能研究院(青岛)有限公司 Processing method, device, equipment and storage medium of point cloud image
CN116962890B (en) * 2023-09-21 2024-01-09 卡奥斯工业智能研究院(青岛)有限公司 Processing method, device, equipment and storage medium of point cloud image

Also Published As

Publication number Publication date
CN114007020A (en) 2022-02-01
CN114007020B (en) 2022-11-29

Similar Documents

Publication Publication Date Title
EP3624439B1 (en) Imaging processing method for camera module in night scene, electronic device and storage medium
CN108419023B (en) Method for generating high dynamic range image and related equipment
EP3694203B1 (en) Method and device for obtaining exposure compensation value of high-dynamic-range image
CN108335279B (en) Image fusion and HDR imaging
WO2019183813A1 (en) Image capture method and device
WO2023060762A1 (en) Image processing method and apparatus, and computer-readable storage medium
WO2020057198A1 (en) Image processing method and device, electronic device and storage medium
WO2020029732A1 (en) Panoramic photographing method and apparatus, and imaging device
JP4826028B2 (en) Electronic camera
WO2020034737A1 (en) Imaging control method, apparatus, electronic device, and computer-readable storage medium
US8477993B2 (en) Image taking apparatus and image taking method
CN108616689B (en) Portrait-based high dynamic range image acquisition method, device and equipment
JP4834725B2 (en) Method and apparatus for incorporating iris color in red-eye correction
CN108401154B (en) Image exposure degree non-reference quality evaluation method
CN110445988A (en) Image processing method, device, storage medium and electronic equipment
CN108337446B (en) High dynamic range image acquisition method, device and equipment based on double cameras
WO2017114399A1 (en) Backlight photographing method and device
CN109618102B (en) Focusing processing method and device, electronic equipment and storage medium
CN101867716A (en) Adjusting method for digital image capturing conditions and digital photographing device
US20070024714A1 (en) Whiteboard camera apparatus and methods
US20160088266A1 (en) Automatic image color correciton using an extended imager
JP4385383B2 (en) Programmable anti-aliasing system and method for a camera
CN110266965B (en) Image processing method, image processing device, storage medium and electronic equipment
CN108337448B (en) High dynamic range image acquisition method and device, terminal equipment and storage medium
CN114866705B (en) Automatic exposure method, storage medium and electronic device