



技术领域technical field
本申请涉及领域,具体涉及自动曝光方法、电子设备及存储介质。The present application relates to the field, in particular to an automatic exposure method, an electronic device and a storage medium.
背景技术Background technique
自动曝光(Automatic Exposure,简称AE)算法是自动地调整相机传感器的曝光参数例如曝光时间、曝光增益来使得相机传感器采集的图像的亮度达到或接近目标亮度的算法。The Automatic Exposure (AE) algorithm is an algorithm that automatically adjusts the exposure parameters of the camera sensor such as exposure time and exposure gain to make the brightness of the image captured by the camera sensor reach or approach the target brightness.
目前的自动曝光算法涉及多次迭代,在一次迭代中,根据一次迭代针对的相机传感器采集的图像的亮度与目标亮度的差异量,调整相机传感器的曝光参数。多次迭代导致自动曝光的耗时长。The current automatic exposure algorithm involves multiple iterations. In one iteration, the exposure parameters of the camera sensor are adjusted according to the amount of difference between the brightness of the image captured by the camera sensor targeted for one iteration and the target brightness. Multiple iterations lead to long auto-exposure time-consuming.
发明内容Contents of the invention
为克服相关技术中存在的问题,本申请提供一种自动曝光方法、电子设备及存储介质。In order to overcome the problems existing in related technologies, the present application provides an automatic exposure method, electronic equipment and a storage medium.
本申请实施例提供一种自动曝光方法,包括:An embodiment of the present application provides an automatic exposure method, including:
基于第一图像对应的第一信息,确定当前环境的检测亮度对应的第一校正亮度,其中,所述第一图像为所述当前环境中的目标相机传感器采集的与预设目标图像亮度的亮度差异量大于差异量阈值的图像,所述第一信息是根据指示在所述预设色温下,检测亮度与校正亮度的对应关系的信息确定的;Based on the first information corresponding to the first image, determine the first corrected brightness corresponding to the detected brightness of the current environment, wherein the first image is the brightness collected by the target camera sensor in the current environment and the preset target image brightness For an image whose difference is greater than a difference threshold, the first information is determined according to the information indicating the corresponding relationship between detected brightness and corrected brightness at the preset color temperature;
基于所述第一校正亮度、所述第一图像对应的第二信息、所述预设目标图像亮度与标定图像亮度的比例,确定第一灵敏度,以及基于所述第一灵敏度,确定第一曝光时间和第一曝光增益,其中,所述第二信息是根据指示在所述预设色温和所述标定图像亮度下,校正亮度与灵敏度的对应关系的信息确定的;Based on the first corrected brightness, the second information corresponding to the first image, the ratio of the preset target image brightness to the calibration image brightness, determine a first sensitivity, and based on the first sensitivity, determine a first exposure time and first exposure gain, wherein the second information is determined according to the information indicating the corresponding relationship between corrected brightness and sensitivity under the preset color temperature and the calibrated image brightness;
将所述目标相机传感器的曝光时间调整为所述第一曝光时间,将所述目标相机传感器的曝光增益调整为所述第一曝光增益。Adjusting the exposure time of the target camera sensor to the first exposure time, and adjusting the exposure gain of the target camera sensor to the first exposure gain.
本申请实施例提供一种电子设备,包括:存储器、处理器及存储在存储器上的计算机程序,该处理器执行该计算机程序以实现上述自动曝光方法。An embodiment of the present application provides an electronic device, including: a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the above automatic exposure method.
本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序/指令,该计算机程序/指令被处理器执行时实现上述自动曝光方法。An embodiment of the present application provides a computer-readable storage medium, on which a computer program/instruction is stored, and when the computer program/instruction is executed by a processor, the foregoing automatic exposure method is implemented.
本申请实施例提供一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现上述自动曝光方法。An embodiment of the present application provides a computer program product, including a computer program/instruction, and when the computer program/instruction is executed by a processor, the foregoing automatic exposure method is implemented.
本申请实施例提供的自动曝光方法,基于第一图像对应的第一信息,确定当前环境的检测亮度对应的第一校正亮度;基于第一校正亮度、第一图像对应的第二信息、预设目标图像亮度与标定图像亮度的比例,确定第一灵敏度,以及基于第一灵敏度,确定第一曝光时间和第一曝光增益;将目标相机传感器的曝光时间调整为所述第一曝光时间,将目标相机传感器的曝光增益调整为第一曝光增益。目标相机传感器在第一灵敏度下采集的图像亮度等于或接近预设目标图像亮度,将目标相机传感器的曝光时间调整为第一曝光时间,将目标相机传感器的曝光增益调整为第一曝光增益,目标相机传感器在第一灵敏度下采集的图像亮度,使得目标相机传感器在第一灵敏度下采集图像,目标相机传感器采集的图像等于或接近预设目标图像亮度。无需多次迭代,自动曝光的耗时短。The automatic exposure method provided by the embodiment of the present application determines the first corrected brightness corresponding to the detected brightness of the current environment based on the first information corresponding to the first image; based on the first corrected brightness, the second information corresponding to the first image, the preset The ratio of the target image brightness to the calibration image brightness determines the first sensitivity, and based on the first sensitivity, determines the first exposure time and the first exposure gain; the exposure time of the target camera sensor is adjusted to the first exposure time, and the target The exposure gain of the camera sensor is adjusted to the first exposure gain. The brightness of the image collected by the target camera sensor at the first sensitivity is equal to or close to the preset target image brightness, the exposure time of the target camera sensor is adjusted to the first exposure time, the exposure gain of the target camera sensor is adjusted to the first exposure gain, and the target The brightness of the image collected by the camera sensor at the first sensitivity makes the image collected by the target camera sensor at the first sensitivity, and the brightness of the image collected by the target camera sensor is equal to or close to the preset target image brightness. No need for multiple iterations, and the time-consuming of automatic exposure is short.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
图1示出了本申请实施例提供的自动曝光方法的流程图;Fig. 1 shows the flowchart of the automatic exposure method provided by the embodiment of the present application;
图2示出了预设色温的第一直线的效果示意图;Fig. 2 shows a schematic diagram of the effect of the first straight line of the preset color temperature;
图3示出了预设色温的第二直线的效果示意图;Fig. 3 shows a schematic diagram of the effect of the second straight line of the preset color temperature;
图4示出了本申请实施例提供的自动曝光装置的结构框图。FIG. 4 shows a structural block diagram of an automatic exposure device provided by an embodiment of the present application.
具体实施方式detailed description
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain related inventions, rather than to limit the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.
近年来,基于人工智能的计算机视觉、深度学习、机器学习、图像处理、图像识别等技术研究取得了重要进展。人工智能(Artificial Intelligence,AI)是研究、开发用于模拟、延伸人的智能的理论、方法、技术及应用系统的新兴科学技术。人工智能学科是一门综合性学科,涉及芯片、大数据、云计算、物联网、分布式存储、深度学习、机器学习、神经网络等诸多技术种类。计算机视觉作为人工智能的一个重要分支,具体是让机器识别世界,计算机视觉技术通常包括人脸识别、活体检测、指纹识别与防伪验证、生物特征识别、人脸检测、行人检测、目标检测、行人识别、图像处理、图像识别、图像语义理解、图像检索、文字识别、视频处理、视频内容识别、行为识别、三维重建、虚拟现实、增强现实、同步定位与地图构建(SLAM)、计算摄影、机器人导航与定位等技术。随着人工智能技术的研究和进步,该项技术在众多领域展开了应用,例如安防、城市管理、交通管理、楼宇管理、园区管理、人脸通行、人脸考勤、物流管理、仓储管理、机器人、智能营销、计算摄影、手机影像、云服务、智能家居、穿戴设备、无人驾驶、自动驾驶、智能医疗、人脸支付、人脸解锁、指纹解锁、人证核验、智慧屏、智能电视、摄像机、移动互联网、网络直播、美颜、美妆、医疗美容、智能测温等领域。In recent years, artificial intelligence-based computer vision, deep learning, machine learning, image processing, image recognition and other technologies have made important progress. Artificial Intelligence (AI) is an emerging science and technology that researches and develops theories, methods, technologies and application systems for simulating and extending human intelligence. The subject of artificial intelligence is a comprehensive subject that involves many technologies such as chips, big data, cloud computing, Internet of Things, distributed storage, deep learning, machine learning, and neural networks. As an important branch of artificial intelligence, computer vision is specifically to allow machines to recognize the world. Computer vision technology usually includes face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, target detection, pedestrian detection, etc. Recognition, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, behavior recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and map construction (SLAM), computational photography, robotics Navigation and positioning technologies. With the research and progress of artificial intelligence technology, this technology has been applied in many fields, such as security, urban management, traffic management, building management, park management, face access, face attendance, logistics management, warehouse management, robots , smart marketing, computational photography, mobile imaging, cloud services, smart home, wearable devices, unmanned driving, automatic driving, smart medical care, face payment, face unlock, fingerprint unlock, witness verification, smart screen, smart TV, Cameras, mobile Internet, webcasting, beauty, cosmetics, medical beauty, intelligent temperature measurement and other fields.
图1示出了本申请实施例提供的自动曝光方法的流程图,该方法包括:Fig. 1 shows the flowchart of the automatic exposure method provided by the embodiment of the present application, the method includes:
步骤101,基于第一图像对应的第一信息,确定当前环境的检测亮度对应的第一校正亮度。Step 101, based on the first information corresponding to the first image, determine the first corrected brightness corresponding to the detected brightness of the current environment.
在本申请中,目标相机传感器并不特指某一个相机传感器,当需要调整一个相机传感器的曝光参数时,该相机传感器作为目标相机传感器。In this application, the target camera sensor does not specifically refer to a certain camera sensor. When the exposure parameters of a camera sensor need to be adjusted, the camera sensor is used as the target camera sensor.
在本申请中,第一图像为当前环境中的目标相机传感器采集的与预设目标图像亮度的亮度差异量大于差异量阈值的图像。In the present application, the first image is an image captured by a target camera sensor in the current environment and having a difference in brightness from a preset target image brightness greater than a difference threshold.
对于任意两个图像,该两个图像的亮度差异量为:该两个图像中的亮度最大的图像的亮度减去该两个图像中的亮度最小的图像的亮度。For any two images, the brightness difference between the two images is: the brightness of the image with the highest brightness among the two images minus the brightness of the image with the smallest brightness among the two images.
在执行步骤101之前,可以按照采集时间从早至晚的次序,检测目标传感器在执行步骤101之前采集的图像的亮度与预设目标图像亮度的亮度差异量是否大于差异量阈值,当检测到一个图像与预设目标图像亮度的亮度差异量大于差异量阈值时,可以将该图像作为第一图像,执行101。Before executing step 101, it is possible to detect whether the brightness difference between the brightness of the image collected by the target sensor before executing step 101 and the brightness of the preset target image is greater than the difference threshold in the order of collection time from early to late, when a When the brightness difference between the brightness of the image and the preset target image is greater than the difference threshold, the image may be used as the first image, and step 101 is executed.
目标相机传感器在执行本申请实施例提供的自动曝光方法的电子设备上,当前环境可以是指:在执行本申请实施例提供的自动曝光方法时执行本申请实施例提供的自动曝光方法的电子设备所在的环境。The target camera sensor is on the electronic device that executes the automatic exposure method provided by the embodiment of the present application, and the current environment may refer to: the electronic device that executes the automatic exposure method provided by the embodiment of the present application when executing the automatic exposure method provided by the embodiment of the present application environment.
可以通过执行本申请实施例提供的自动曝光方法的电子设备上的环境光传感器检测当前环境的检测亮度。The detected brightness of the current environment may be detected by an ambient light sensor on the electronic device implementing the automatic exposure method provided in the embodiment of the present application.
当前环境的检测亮度可以是指:当前环境中的目标相机传感器接收的光的亮度。The detected brightness of the current environment may refer to: the brightness of light received by the target camera sensor in the current environment.
当执行步骤101时,从执行本申请实施例提供的自动曝光方法的电子设备上的环境光传感器获取当前环境的检测亮度。When step 101 is executed, the detected brightness of the current environment is acquired from the ambient light sensor on the electronic device executing the automatic exposure method provided by the embodiment of the present application.
本申请中的预设色温可以为常用的光源发出的光的色温,预设色温也可以称之为色温锚点。The preset color temperature in this application may be the color temperature of light emitted by a commonly used light source, and the preset color temperature may also be called a color temperature anchor point.
例如,D75光源发出的光的色温、D65光源发出的光的色温、D50光源发出的光的色温、CWF光源发出的光的色温、TL84光源发出的光的色温、A光源发出的光的色温均为预设色温,本申请中的多个预设色温包括:D75光源发出的光的色温、D65光源发出的光的色温、D50光源发出的光的色温、CWF光源发出的光的色温、TL84光源发出的光的色温、A光源发出的光的色温。For example, the color temperature of the light emitted by the D75 light source, the color temperature of the light emitted by the D65 light source, the color temperature of the light emitted by the D50 light source, the color temperature of the light emitted by the CWF light source, the color temperature of the light emitted by the TL84 light source, and the color temperature of the light emitted by the A light source. The multiple preset color temperatures in this application include: the color temperature of the light emitted by the D75 light source, the color temperature of the light emitted by the D65 light source, the color temperature of the light emitted by the D50 light source, the color temperature of the light emitted by the CWF light source, and the color temperature of the light emitted by the TL84 light source The color temperature of the emitted light, the color temperature of the light emitted by the A light source.
在本申请中,第一图像对应的第一信息是根据指示在预设色温下,检测亮度与校正亮度的对应关系的信息确定的。In the present application, the first information corresponding to the first image is determined according to the information indicating the corresponding relationship between detected brightness and corrected brightness at a preset color temperature.
对于任意一个预设色温,指示在该预设色温下,检测亮度与校正亮度的对应关系的信息可以为:该预设色温的第一直线。For any preset color temperature, the information indicating the corresponding relationship between detected brightness and corrected brightness at the preset color temperature may be: the first straight line of the preset color temperature.
对于任意一个预设色温,该预设色温的第一直线在检测亮度-校正亮度坐标系中。For any preset color temperature, the first straight line of the preset color temperature is in the detected brightness-corrected brightness coordinate system.
请参考图2,其示出了预设色温的第一直线的效果示意图。Please refer to FIG. 2 , which shows a schematic diagram of the effect of the first straight line of the preset color temperature.
在图2中,示出了检测亮度-校正亮度坐标系,示例性地示出了D75光源发出的光的色温的第一直线、D50光源发出的光的色温的第一直线、A光源发出的光的色温的第一直线。In Fig. 2, the detected luminance-corrected luminance coordinate system is shown, exemplarily showing the first straight line of the color temperature of the light emitted by the D75 light source, the first straight line of the color temperature of the light emitted by the D50 light source, and the A light source The first straight line for the color temperature of the emitted light.
在本申请中,第一图像对应的第一信息可以为:第一图像对应的第一直线。In the present application, the first information corresponding to the first image may be: the first straight line corresponding to the first image.
当第一图像过度曝光时,第一图像对应的第一直线的斜率可以为:多个预设色温的第一直线的斜率的平均值。When the first image is overexposed, the slope of the first straight line corresponding to the first image may be: an average value of the slopes of the first straight line of multiple preset color temperatures.
当第一图像没有过度曝光时,第一图像对应的第一直线的斜率可以为:多个预设色温中的与当前环境的色温最接近的两个预设色温的第一直线的斜率的平均值。When the first image is not overexposed, the slope of the first straight line corresponding to the first image may be: the slope of the first straight line of the two preset color temperatures closest to the color temperature of the current environment among the multiple preset color temperatures average of.
在本申请中,当前环境的色温是指:当前环境中的目标相机传感器接收的光的色温。In this application, the color temperature of the current environment refers to the color temperature of light received by the target camera sensor in the current environment.
可以按照预设色温与当前环境的色温的色温差异量从大至小,对多个预设色温进行排序,前两个预设色温即为与当前环境的色温最接近的两个预设色温。The multiple preset color temperatures can be sorted according to the color temperature difference between the preset color temperature and the color temperature of the current environment from large to small, and the first two preset color temperatures are the two preset color temperatures closest to the color temperature of the current environment.
对于任意一个预设色温,该预设色温与当前环境的色温的色温差异量为:该预设色温与当前环境的色温中的最大的色温减去该预设色温与当前环境的色温中的最小的色温。For any preset color temperature, the color temperature difference between the preset color temperature and the color temperature of the current environment is: the maximum color temperature between the preset color temperature and the color temperature of the current environment minus the minimum color temperature between the preset color temperature and the color temperature of the current environment color temperature.
在本申请中,当基于第一图像对应的第一信息,确定当前环境的检测亮度对应的第一校正亮度时,可以确定第一图像对应的第一直线上的对应当前环境的点,第一图像对应的第一直线上的对应当前环境的点的横坐标值为:当前环境的检测亮度,第一图像对应的第一直线上的对应当前环境的点的纵坐标即为当前环境的检测亮度对应的第一校正亮度。In the present application, when the first corrected brightness corresponding to the detected brightness of the current environment is determined based on the first information corresponding to the first image, the point corresponding to the current environment on the first straight line corresponding to the first image can be determined. The abscissa value of the point corresponding to the current environment on the first straight line corresponding to an image is: the detected brightness of the current environment, and the ordinate of the point corresponding to the current environment on the first straight line corresponding to the first image is the current environment The detected brightness corresponds to the first corrected brightness.
在本申请中,可以通过以下步骤确定一个图像是否过度曝光:当该图像中的具有大于像素点亮度阈值的亮度的像素点的数量大于像素点数量阈值时,确定该图像过度曝光,当该图像中的具有大于像素点亮度阈值的亮度的像素点的数量小于或等于像素点数量阈值时,确定该图像没有过度曝光。In the present application, whether an image is overexposed can be determined through the following steps: When the number of pixels in the image with a brightness greater than the pixel brightness threshold is greater than the pixel number threshold, it is determined that the image is overexposed, and when the image When the number of pixels with brightness greater than the pixel brightness threshold is less than or equal to the pixel number threshold, it is determined that the image is not overexposed.
在本申请中,还可以以下步骤确定一个图像是否过度曝光:将该图像划分为多个分块,多个分块中的每一个分块的大小相同;对于该每一个分块,计算该分块的所有像素点的亮度的平均值,将该平均值作为该分块的亮度;当具有大于分块亮度阈值的亮度的分块的数量大于分块数量阈值时,确定该图像过度曝光,当该图像中的具有大于分块亮度阈值的亮度的分块的数量小于或等于分块数量阈值时,确定该图像没有过度曝光。In the present application, the following steps can also be used to determine whether an image is overexposed: the image is divided into a plurality of sub-blocks, and the size of each sub-block in the multiple sub-blocks is the same; for each sub-block, the sub-block is calculated. The average value of the brightness of all pixels of the block, the average value is used as the brightness of the block; when the number of blocks with brightness greater than the block brightness threshold is greater than the block number threshold, it is determined that the image is overexposed, when It is determined that the image is not overexposed when the number of blocks in the image having brightness greater than the block brightness threshold is less than or equal to the block number threshold.
在本申请中,可以通过以下步骤确定一个图像的亮度:计算图像的每一个像素点的亮度,对于任意一个像素点,该像素点的亮度Y=0.3*R+0.6*G+0.1*B,R为该像素点的R通道值,G为该像素点的G通道值,B为该像素点的B通道值;计算该图像的所有像素点的亮度的平均值,将该图像的所有像素点的亮度的平均值作为该图像的亮度。In this application, the brightness of an image can be determined through the following steps: calculate the brightness of each pixel of the image, for any pixel, the brightness of the pixel Y=0.3*R+0.6*G+0.1*B, R is the R channel value of the pixel, G is the G channel value of the pixel, and B is the B channel value of the pixel; calculate the average value of the brightness of all the pixels of the image, and calculate all the pixels of the image The average value of the luminance is used as the luminance of the image.
也可以通过以下步骤确定一个图像的亮度:对该图像进行提亮处理例如gamma2.2处理;计算该图像中的每一个像素点的亮度,该像素点的亮度Y=0.3*R’+0.6*G’+0.1*B’,R’为提亮处理之后该像素点的R通道值,G’为提亮处理之后该像素点的G通道值,B’为提亮处理之后该像素点的B通道值;计算该图像的所有像素点的亮度的平均值,将该图像的所有像素点的亮度的平均值作为该图像的亮度。The brightness of an image can also be determined through the following steps: brighten the image such as gamma2.2 processing; calculate the brightness of each pixel in the image, the brightness of the pixel Y=0.3*R'+0.6* G'+0.1*B', R' is the R channel value of the pixel after the brightening process, G' is the G channel value of the pixel after the brightening process, and B' is the B channel of the pixel after the brightening process Channel value; calculate the average brightness of all pixels of the image, and use the average brightness of all pixels of the image as the brightness of the image.
在本申请中,对于任意一个预设色温,可以通过以下步骤生成该预设色温的第一直线:In this application, for any preset color temperature, the first straight line of the preset color temperature can be generated through the following steps:
光源发出的该预设色温的光照射用于测试的电子设备;The light of the preset color temperature emitted by the light source irradiates the electronic equipment used for testing;
对于多个预设亮度中的每一个预设亮度,控制该光源发出亮度为该预设亮度的光,用于测试的电子设备上的环境光传感器接收该光,用于测试的电子设备上的环境光传感器输出一个检测亮度,该检测亮度和该预设亮度组成一个检测亮度-预设亮度组合;For each preset brightness among the plurality of preset brightnesses, the light source is controlled to emit light with brightness equal to the preset brightness, and the ambient light sensor on the electronic device for testing receives the light, and the light sensor on the electronic device for testing receives the light. The ambient light sensor outputs a detection brightness, and the detection brightness and the preset brightness form a detection brightness-preset brightness combination;
生成每一个检测亮度-预设亮度组合对应的点,每一个检测亮度-预设亮度组合对应的点在检测亮度-校正亮度坐标系中,检测亮度-校正亮度坐标系的横坐标轴为检测亮度坐标轴,检测亮度-校正亮度坐标系的纵坐标轴为校正亮度坐标轴;Generate points corresponding to each detected brightness-preset brightness combination, each point corresponding to the detected brightness-preset brightness combination is in the detected brightness-corrected brightness coordinate system, and the abscissa axis of the detected brightness-corrected brightness coordinate system is the detected brightness Coordinate axis, the ordinate axis of the detection brightness-correction brightness coordinate system is the correction brightness coordinate axis;
对于每一个检测亮度-预设亮度组合,该检测亮度-预设亮度组合对应的点的横坐标值为:该检测亮度-预设亮度组合中的检测亮度,该检测亮度-预设亮度组合对应的点的纵坐标值为:该检测亮度-预设亮度组合中的预设亮度;For each detection brightness-preset brightness combination, the abscissa value of the point corresponding to the detection brightness-preset brightness combination is: the detection brightness in the detection brightness-preset brightness combination, the detection brightness-preset brightness combination corresponds to The ordinate value of the point is: the preset brightness in the detection brightness-preset brightness combination;
对每一个检测亮度-预设亮度组合对应的点进行直线拟合,例如,利用最小二乘法对每一个检测亮度-预设亮度组合对应的点进行直线拟合,得到该预设色温的第一直线。Perform straight line fitting on the points corresponding to each detected brightness-preset brightness combination, for example, use the least square method to perform straight line fitting on the points corresponding to each detected brightness-preset brightness combination to obtain the first color temperature of the preset color temperature straight line.
步骤102,基于当前环境的检测亮度对应的第一校正亮度、第一图像对应的第二信息、预设目标图像亮度与标定图像亮度的比例,确定第一灵敏度,基于第一灵敏度,确定第一曝光时间和第一曝光增益。Step 102: Determine the first sensitivity based on the first corrected brightness corresponding to the detected brightness of the current environment, the second information corresponding to the first image, the ratio of the brightness of the preset target image to the brightness of the calibration image, and determine the first sensitivity based on the first sensitivity. Exposure time and first exposure gain.
在本申请中,预设目标图像亮度与标定图像亮度的比例为:预设目标图像亮度除以标定图像亮度。In the present application, the ratio of the brightness of the preset target image to the brightness of the calibration image is: the brightness of the preset target image divided by the brightness of the calibration image.
预设目标图像亮度为:期望的图像亮度,标定图像亮度为:为了得到指示在预设色温和标定图像亮度下,校正亮度与灵敏度的对应关系的信息而设置的图像亮度。The preset target image brightness is: desired image brightness, and the calibrated image brightness is: the image brightness set for obtaining information indicating the corresponding relationship between corrected brightness and sensitivity under the preset color temperature and calibrated image brightness.
可选的,标定图像亮度为48。Optionally, the calibrated image brightness is 48.
在本申请中,第一图像对应的第二信息是根据指示在预设色温和标定图像亮度下,校正亮度与灵敏度的对应关系的信息确定的。In the present application, the second information corresponding to the first image is determined according to the information indicating the corresponding relationship between corrected brightness and sensitivity under the preset color temperature and calibrated image brightness.
对于任意一个预设色温,指示在该预设色温和标定图像亮度下,校正亮度与灵敏度的对应关系的信息可以为:该预设色温的第二直线。For any preset color temperature, the information indicating the corresponding relationship between corrected brightness and sensitivity under the preset color temperature and calibrated image brightness may be: the second straight line of the preset color temperature.
对于任意一个预设色温,该预设色温的第二直线在校正亮度-灵敏度坐标系中。For any preset color temperature, the second straight line of the preset color temperature is in the corrected brightness-sensitivity coordinate system.
请参考图3,其示出了预设色温的第二直线的效果示意图。Please refer to FIG. 3 , which shows a schematic diagram of the effect of the second straight line of the preset color temperature.
在图3中,示出了校正亮度-灵敏度坐标系,示例性地示出了D75光源发出的光的色温的第二直线、D50光源发出的光的色温的第二直线、A光源发出的光的色温的第二直线。In Fig. 3, the coordinate system of corrected brightness-sensitivity is shown, and the second straight line of the color temperature of the light emitted by the D75 light source, the second straight line of the color temperature of the light emitted by the D50 light source, and the light emitted by the A light source are exemplarily shown. The second straight line of the color temperature.
在本申请中,第一图像对应的第二信息可以为:第一图像对应的第二直线。In the present application, the second information corresponding to the first image may be: the second straight line corresponding to the first image.
第一图像对应的第二直线在校正亮度-灵敏度坐标系中。The second straight line corresponding to the first image is in the corrected brightness-sensitivity coordinate system.
在本申请中,当前环境的色温可以是指:当前环境中的目标相机传感器接收的光的色温。In this application, the color temperature of the current environment may refer to: the color temperature of light received by the target camera sensor in the current environment.
在本申请中,当第一图像过度曝光时,第一图像对应的第二直线的斜率可以为:多个预设色温的第二直线的斜率的平均值。In the present application, when the first image is overexposed, the slope of the second straight line corresponding to the first image may be: an average value of the slopes of the second straight lines of multiple preset color temperatures.
当第一图像没有过度曝光时,第一图像对应的第二直线的斜率可以为:与当前环境的色温最接近的两个预设色温的第二直线的斜率的平均值。When the first image is not overexposed, the slope of the second straight line corresponding to the first image may be an average of the slopes of the second straight lines of two preset color temperatures closest to the color temperature of the current environment.
在本申请中,当基于当前环境的检测亮度对应的第一校正亮度、第一图像对应的第二信息、预设目标图像亮度与标定图像亮度的比例时,可以确定第一图像对应的第二直线上的对应当前环境的点,第一图像对应的第二直线上的对应当前环境的点的横坐标值为:当前环境的检测亮度对应的第一校正亮度,第一图像对应的第二直线上的对应当前环境的点的纵坐标为:对应当前环境的检测亮度对应的第一校正亮度的灵敏度。In this application, based on the first corrected brightness corresponding to the detected brightness of the current environment, the second information corresponding to the first image, and the ratio of the preset target image brightness to the calibration image brightness, the second corrected brightness corresponding to the first image can be determined. The point on the straight line corresponding to the current environment, the abscissa value of the point corresponding to the current environment on the second straight line corresponding to the first image is: the first corrected brightness corresponding to the detected brightness of the current environment, the second straight line corresponding to the first image The ordinate of the point corresponding to the current environment on is: the sensitivity of the first corrected brightness corresponding to the detected brightness corresponding to the current environment.
然后,可以通过以下公式计算出第一灵敏度:Then, the first sensitivity can be calculated by the following formula:
第一灵敏度=标定_sensitivity*True_target/标定_target;First sensitivity = Calibration_sensitivity*True_target/Calibration_target;
其中,标定_sensitivity表示对应当前环境的检测亮度对应的第一校正亮度的灵敏度,True_target表示预设目标图像亮度,标定_target表示标定图像亮度,True_target/标定_target表示预设目标图像亮度与标定图像亮度的比例。Among them, calibration_sensitivity indicates the sensitivity of the first corrected brightness corresponding to the detected brightness of the current environment, True_target indicates the brightness of the preset target image, calibration_target indicates the brightness of the calibrated image, and True_target/calibrated_target indicates the brightness of the preset target image and calibration Scale of image brightness.
在本申请中,第一灵敏度为第一曝光时间与第一曝光增益的乘积。当基于第一灵敏度,确定第一曝光时间和第一曝光增益时,可以从多个预设曝光时间中随机选择一个预设曝光时间,将选择的预设曝光时间作为第一曝光时间,将第一灵敏度除以第一曝光时间,得到第一曝光增益。也可以从多个预设曝光增益中随机选择一个预设曝光增益,将选择的预设曝光增益作为第一曝光增益,将第一灵敏度除以第一曝光增益,得到第一曝光时间。In this application, the first sensitivity is the product of the first exposure time and the first exposure gain. When determining the first exposure time and the first exposure gain based on the first sensitivity, one preset exposure time can be randomly selected from a plurality of preset exposure times, and the selected preset exposure time is used as the first exposure time, and the second A sensitivity is divided by the first exposure time to obtain a first exposure gain. It is also possible to randomly select a preset exposure gain from multiple preset exposure gains, use the selected preset exposure gain as the first exposure gain, and divide the first sensitivity by the first exposure gain to obtain the first exposure time.
在本申请中,为了得到每一个预设色温的第二直线,可以将多个预设曝光时间中的预设曝光时间与多个预设曝光增益中的预设曝光增益进行组合,得到多个预设曝光时间-预设曝光增益组合。In this application, in order to obtain the second straight line for each preset color temperature, the preset exposure time among the multiple preset exposure times can be combined with the preset exposure gain among the multiple preset exposure gains to obtain multiple Preset exposure time - preset exposure gain combination.
对于每一个预设曝光时间-预设曝光增益组合,将该预设曝光时间-预设曝光增益组合中的预设曝光时间与该预设曝光时间-预设曝光增益组合中的预设曝光增益相乘,得到对应该预设曝光时间-预设曝光增益组合的一个预设灵敏度。For each preset exposure time-preset exposure gain combination, the preset exposure time in the preset exposure time-preset exposure gain combination and the preset exposure gain in the preset exposure time-preset exposure gain combination Multiplied together, a preset sensitivity corresponding to the preset exposure time-preset exposure gain combination is obtained.
例如,预设曝光时间100ms与预设曝光增益30x组成一个对应预设灵敏度3000的预设曝光时间-预设曝光增益组合。预设曝光时间50ms与预设曝光增益30x组成一个对应预设灵敏度1500的预设曝光时间-预设曝光增益组合。For example, the preset exposure time of 100ms and the preset exposure gain of 30x constitute a preset exposure time-preset exposure gain combination corresponding to a preset sensitivity of 3000. The preset exposure time of 50ms and the preset exposure gain of 30x constitute a preset exposure time-preset exposure gain combination corresponding to a preset sensitivity of 1500.
在本申请中,对于任意一个预设色温,可以通过以下步骤得到该预设色温的第二直线:In this application, for any preset color temperature, the second straight line of the preset color temperature can be obtained through the following steps:
光源发出的该预设色温的光照射用于测试的电子设备;The light of the preset color temperature emitted by the light source irradiates the electronic equipment used for testing;
将除了曝光时间和曝光增益之外的影响曝光效果的参数称之为其他曝光参数,例如,光圈、感光度均为其他曝光参数;Parameters that affect the exposure effect other than exposure time and exposure gain are called other exposure parameters, for example, aperture and sensitivity are other exposure parameters;
在得到预设色温的第二直线期间,对于用于测试的电子设备上的相机传感器的任意一个其他曝光参数,该其他曝光参数等于在执行步骤101时目标相机传感器的属于该其他曝光参数的类型的影响曝光效果的参数,例如,在得到预设色温的第二直线期间,用于测试的电子设备上的相机传感器的光圈等于在执行步骤101时目标相机传感器的光圈,用于测试的电子设备上的相机传感器的感光度等于在执行步骤101时目标相机传感器的感光度;During obtaining the second straight line of the preset color temperature, for any other exposure parameter of the camera sensor on the electronic device used for testing, the other exposure parameter is equal to the type of the target camera sensor belonging to the other exposure parameter when step 101 is performed The parameters that affect the exposure effect, for example, during the second straight line of the preset color temperature, the aperture of the camera sensor on the electronic device used for testing is equal to the aperture of the target camera sensor when step 101 is performed, the electronic device used for testing The sensitivity of the camera sensor above is equal to the sensitivity of the target camera sensor when performing step 101;
对于每一个预设灵敏度,将该预设灵敏度对应的预设曝光时间-预设曝光增益组合中的预设曝光时间作为用于测试的电子设备上的相机传感器的曝光时间,将该对应的预设曝光时间-预设曝光增益组合中的预设灵敏度作为用于测试的电子设备上的相机传感器的曝光增益;For each preset sensitivity, the preset exposure time corresponding to the preset sensitivity-the preset exposure gain combination is used as the exposure time of the camera sensor on the electronic device for testing, and the corresponding preset Setting the preset sensitivity in the exposure time-preset exposure gain combination as the exposure gain of the camera sensor on the electronic device for testing;
对于每一个预设灵敏度,在将该预设灵敏度对应的预设曝光时间-预设曝光增益组合中的预设曝光时间作为用于测试的电子设备上的相机传感器的曝光时间,将该对应的预设曝光时间-预设曝光增益组合中的预设灵敏度作为用于测试的电子设备上的相机传感器的曝光增益之后,用于测试的电子设备上的相机传感器拍摄18%灰卡即反射率为18%的灰色卡片,用于测试的电子设备上的相机传感器采集18%灰卡的图像;不断地调整该光源发出的光的亮度,直到用于测试的电子设备上的相机传感器采集的18%灰卡的图像的亮度达到标定图像亮度;For each preset sensitivity, when the preset exposure time in the preset exposure time-preset exposure gain combination corresponding to the preset sensitivity is used as the exposure time of the camera sensor on the electronic device for testing, the corresponding The preset sensitivity in the preset exposure time-preset exposure gain combination is used as the exposure gain of the camera sensor on the electronic device for testing. After that, the camera sensor on the electronic device for testing shoots 18% gray card that is, the reflectance is 18% gray card, image captured by the camera sensor on the electronic device used for testing 18% gray card; continuously adjust the brightness of the light emitted by this light source until 18% is captured by the camera sensor on the electronic device used for testing The brightness of the image on the gray card reaches the calibrated image brightness;
对于任意一个预设灵敏度,当用于测试的电子设备上的相机传感器采集的图像的亮度达到标定图像亮度时,从用于测试的电子设备上的环境光传感器获取光源发出的光的检测亮度,确定获取到的检测亮度对应校正亮度,获取到的检测亮度对应校正亮度与该预设灵敏度构成一个校正亮度-灵敏度组合;For any preset sensitivity, when the brightness of the image collected by the camera sensor on the electronic device for testing reaches the calibrated image brightness, the detected brightness of the light emitted by the light source is obtained from the ambient light sensor on the electronic device for testing, It is determined that the obtained detected brightness corresponds to the corrected brightness, and the obtained detected brightness corresponds to the corrected brightness and the preset sensitivity constitutes a corrected brightness-sensitivity combination;
生成每一个校正亮度-灵敏度组合对应的点,每一个校正亮度-灵敏度组合在校正亮度-灵敏度坐标系中,对于每一个校正亮度-灵敏度组合,该校正亮度-灵敏度组合对应的点的横坐标值为:校正亮度-灵敏度组合中的校正亮度,该校正亮度-灵敏度组合对应的点的纵坐标值为校正亮度-灵敏度组合中的灵敏度;Generate points corresponding to each corrected brightness-sensitivity combination, each corrected brightness-sensitivity combination is in the corrected brightness-sensitivity coordinate system, for each corrected brightness-sensitivity combination, the abscissa value of the point corresponding to the corrected brightness-sensitivity combination is: the corrected brightness in the corrected brightness-sensitivity combination, the ordinate value of the point corresponding to the corrected brightness-sensitivity combination is the sensitivity in the corrected brightness-sensitivity combination;
对每一个校正亮度-灵敏度组合对应的点进行直线拟合,例如,利用最小二乘法对对每一个校正亮度-灵敏度组合对应的点进行直线拟合,得到该预设色温的第二直线。Perform straight line fitting on the points corresponding to each corrected brightness-sensitivity combination, for example, use the least square method to perform straight line fitting on the points corresponding to each corrected brightness-sensitivity combination to obtain the second straight line of the preset color temperature.
步骤103,将目标相机传感器的曝光时间调整为第一曝光时间,将目标相机传感器的曝光增益调整为第一曝光增益。
通过将目标相机传感器的曝光时间调整为第一曝光时间,目标相机传感器的曝光时间从开始执行步骤101时目标相机传感器的曝光时间转变为第一曝光时间。By adjusting the exposure time of the target camera sensor to the first exposure time, the exposure time of the target camera sensor changes from the exposure time of the target camera sensor when step 101 is started to the first exposure time.
通过将目标相机传感器的曝光增益调整为第一曝光增益,目标相机传感器的第一曝光增益从开始执行步骤101时目标相机传感器的曝光增益转变为第一曝光增益。By adjusting the exposure gain of the target camera sensor to the first exposure gain, the first exposure gain of the target camera sensor is changed from the exposure gain of the target camera sensor when step 101 is started to the first exposure gain.
在一些实施例中,第一图像过度曝光,第一图像对应的第一信息为具有第一斜率的直线;还包括:基于多个预设色温中的每一个预设色温的第一直线的斜率和该每一个预设色温的预设权重,得到第一斜率。In some embodiments, the first image is overexposed, and the first information corresponding to the first image is a straight line with a first slope; it also includes: the first straight line based on each preset color temperature in the plurality of preset color temperatures The slope and the preset weight of each preset color temperature are used to obtain the first slope.
在本申请中,当第一图像过度曝光时,第一图像对应的第一信息可以为具有第一斜率的直线,具有第一斜率的直线在检测亮度-校正亮度坐标系中,In the present application, when the first image is overexposed, the first information corresponding to the first image may be a straight line with a first slope, and the straight line with the first slope is in the detected brightness-corrected brightness coordinate system,
基于多个预设色温中的每一个预设色温的第一直线的斜率和每一个预设色温的预设权重,得到第一斜率可以表示为:Based on the slope of the first straight line of each preset color temperature among the plurality of preset color temperatures and the preset weight of each preset color temperature, the first slope can be expressed as:
第一斜率=(Weight_1*K_1+...+Weight_n*K_n)/(Weight_1+...+Weight_n);The first slope=(Weight_1*K_1+...+Weight_n*K_n)/(Weight_1+...+Weight_n);
其中,n表示多个预设色温包括的预设色温的数量,Weight1表示第1个预设色温的预设权重,Weight_n表示第n个预设色温的预设权重,K_1表示第1个预设色温的第一直线的斜率,K_n表示第n个预设色温的第一直线的斜率,预设色温的次序是随机的。Among them, n represents the number of preset color temperatures included in multiple preset color temperatures, Weight1 represents the preset weight of the first preset color temperature, Weight_n represents the preset weight of the nth preset color temperature, K_1 represents the first preset The slope of the first straight line of the color temperature, K_n represents the slope of the first straight line of the nth preset color temperature, and the order of the preset color temperatures is random.
预设色温的预设权重的大小可以与在具有预设色温的环境或具有接近预设色温的色温的环境中进行自动曝光的次数的多少相关,若在具有预设色温的环境或具有接近预设色温的色温的环境中进行自动曝光的次数较多,预设色温的预设权重的预设权重较大,若在具有预设色温的环境或具有接近预设色温的色温的环境中进行自动曝光的次数较少,预设色温的预设权重的预设权重较小。The preset weight of the preset color temperature may be related to the number of times of automatic exposure in an environment with a preset color temperature or an environment with a color temperature close to the preset color temperature. The number of times of automatic exposure is more in the environment with the color temperature of the preset color temperature, and the preset weight of the preset color temperature is larger. The fewer the number of exposures, the lower the preset weight of the preset color temperature.
例如,多个预设色温包括:D75光源发出的光的色温、D65光源发出的光的色温、D50光源发出的光的色温、TL84光源发出的光的色温、CWF光源发出的光的色温。D75光源发出的光为北方平均太阳光、D65光源发出的光为国际标准人工日光、D50发出的光为太阳光、TL84光源发出的光为欧洲商店中的灯光、CWF光源发出的光为美国商店中的灯光。由于自动曝光经常在白天发生,D75光源发出的光的色温的预设权重、D65光源发出的光的色温的预设权重、D50光源发出的光的色温的预设权重均较大,TL84光源发出的光的色温的预设权重、CWF光源发出的光的色温的预设权重均较小。For example, the multiple preset color temperatures include: the color temperature of the light emitted by the D75 light source, the color temperature of the light emitted by the D65 light source, the color temperature of the light emitted by the D50 light source, the color temperature of the light emitted by the TL84 light source, and the color temperature of the light emitted by the CWF light source. The light emitted by the D75 light source is the northern average sunlight, the light emitted by the D65 light source is the international standard artificial daylight, the light emitted by the D50 light source is sunlight, the light emitted by the TL84 light source is the light in European stores, and the light emitted by the CWF light source is the American store lights in. Since automatic exposure often occurs during the day, the preset weights of the color temperature of the light emitted by the D75 light source, the preset weights of the color temperature of the light emitted by the D65 light source, and the preset weights of the color temperature of the light emitted by the D50 light source are all relatively large. The preset weight of the color temperature of the light from the CWF light source and the preset weight of the color temperature of the light emitted by the CWF light source are both relatively small.
在一些实施例中,第一图像过度曝光,第一图像对应的第二信息为具有第二斜率的直线;还包括:基于每一个预设色温的第二直线的斜率和每一个预设色温的预设权重,得到第二斜率。In some embodiments, the first image is overexposed, and the second information corresponding to the first image is a straight line with a second slope; it also includes: the slope of the second straight line based on each preset color temperature and the value of each preset color temperature Preset the weight to get the second slope.
在本申请中,当第一图像过度曝光时,第一图像对应的第二信息可以为具有第二斜率的直线,具有第二斜率的直线在校正亮度-灵敏度坐标系中。In the present application, when the first image is overexposed, the second information corresponding to the first image may be a straight line with a second slope, and the straight line with the second slope is in the corrected brightness-sensitivity coordinate system.
基于每一个预设色温的第二直线的斜率和每一个预设色温的预设权重,得到第二斜率可以表示为:Based on the slope of the second straight line of each preset color temperature and the preset weight of each preset color temperature, the second slope can be expressed as:
第二斜率=(Weight_1*K’_1+...+Weight_n*K’_n)/(Weight_1+...+Weight_n);The second slope = (Weight_1*K'_1+...+Weight_n*K'_n)/(Weight_1+...+Weight_n);
其中,n表示多个预设色温包括的预设色温的数量,Weight_1表示第1个预设色温的预设权重,Weight_n表示第n个预设色温的预设权重,K’_1表示第1个预设色温的第二直线的斜率,K’_n表示第n个预设色温的第二直线的斜率,预设色温的次序是随机的。Among them, n represents the number of preset color temperatures included in multiple preset color temperatures, Weight_1 represents the preset weight of the first preset color temperature, Weight_n represents the preset weight of the nth preset color temperature, and K'_1 represents the first The slope of the second straight line of the preset color temperature, K'_n represents the slope of the second straight line of the nth preset color temperature, and the order of the preset color temperatures is random.
在一些实施例中,第一图像没有过度曝光,第一信息为具有第三斜率的直线;还包括:当当前环境的色温与多个预设色温中的一个预设色温相同时,将该预设色温的第一直线的斜率作为第三斜率;当当前环境的色温在预设色温区间中并且不同于多个预设色温中的任意一个预设色温时,在与当前环境的色温最接近的两个预设色温中的一个预设色温的第一直线的斜率和与当前环境的色温最接近的两个预设色温中的另一个预设色温的第一直线的斜率之间进行插值,得到第三斜率,其中,预设色温区间是根据多个预设色温中的最大的预设色温和最小的预设色温确定的;当当前环境的色温不在预设色温区间中时,将多个预设色温中的最大的预设色温的第一直线的斜率或多个预设色温中的最小的预设色温的第一直线的斜率作为第三斜率。In some embodiments, the first image is not overexposed, and the first information is a straight line with a third slope; it also includes: when the color temperature of the current environment is the same as one of the preset color temperatures, the preset Set the slope of the first straight line of the color temperature as the third slope; when the color temperature of the current environment is in the preset color temperature range and is different from any one of the preset color temperatures, the color temperature closest to the current environment Between the slope of the first straight line of one of the two preset color temperatures and the slope of the first straight line of the other of the two preset color temperatures closest to the color temperature of the current environment interpolation to obtain a third slope, wherein the preset color temperature range is determined according to the largest preset color temperature among the multiple preset color temperatures; when the color temperature of the current environment is not in the preset color temperature range, the The slope of the first straight line with the largest preset color temperature among the multiple preset color temperatures or the slope of the first straight line with the smallest preset color temperature among the multiple preset color temperatures is used as the third slope.
在本申请中,当第一图像没有过度曝光时,第一图像对应的第一信息可以为具有第三斜率的直线。In the present application, when the first image is not overexposed, the first information corresponding to the first image may be a straight line with a third slope.
当第一图像没有过度曝光时,若当前环境的色温与多个预设色温中的一个预设色温相同,将与当前环境的色温相同的预设色温的第一直线的斜率作为第三斜率。When the first image is not overexposed, if the color temperature of the current environment is the same as one of the preset color temperatures, the slope of the first straight line of the preset color temperature that is the same as the color temperature of the current environment is used as the third slope .
例如,当前环境的色温为5000k,多个预设色温包括:D75光源发出的光的色温、D65光源发出的光的色温、D50光源发出的光的色温、CWF光源发出的光的色温、TL84光源发出的光的色温、A光源发出的光的色温,D50光源发出的光的色温为5000k,当前环境的色温与D50光源发出的光的色温相同,将5000k的第一直线的斜率作为第三斜率。For example, the color temperature of the current environment is 5000k, and the multiple preset color temperatures include: the color temperature of the light emitted by the D75 light source, the color temperature of the light emitted by the D65 light source, the color temperature of the light emitted by the D50 light source, the color temperature of the light emitted by the CWF light source, and the TL84 light source The color temperature of the emitted light, the color temperature of the light emitted by the light source A, the color temperature of the light emitted by the D50 light source is 5000k, the color temperature of the current environment is the same as the color temperature of the light emitted by the D50 light source, and the slope of the first straight line at 5000k is taken as the third slope.
在本申请中,预设色温区间可以表示为:[mind,maxd],其中,mind表示多个预设色温中的最小的预设色温,maxd表示多个预设色温中的最大的预设色温。In this application, the preset color temperature range can be expressed as: [mind, maxd], wherein mind represents the smallest preset color temperature among multiple preset color temperatures, and maxd represents the largest preset color temperature among multiple preset color temperatures .
在本申请中,当第一图像没有过度曝光时,若当前环境的色温在预设色温区间中并且不同于多个预设色温中的任意一个预设色温,在与当前环境的色温最接近的两个预设色温中的一个预设色温的第一直线的斜率和与当前环境的色温最接近的两个预设色温中的另一个预设色温的第一直线的斜率之间进行插值,得到第三斜率。In this application, when the first image is not overexposed, if the color temperature of the current environment is within the preset color temperature interval and is different from any one of the preset color temperatures, the color temperature closest to the current environment Interpolate between the slope of the first straight line of one of the two preset color temperatures and the slope of the first straight line of the other of the two preset color temperatures closest to the color temperature of the current environment , to get the third slope.
可以按照预设色温与当前环境的色温的色温差异量从大至小,对多个预设色温进行排序,前两个预设色温即为与当前环境的色温最接近的两个预设色温。The multiple preset color temperatures can be sorted according to the color temperature difference between the preset color temperature and the color temperature of the current environment from large to small, and the first two preset color temperatures are the two preset color temperatures closest to the color temperature of the current environment.
对于任意一个预设色温,该预设色温与当前环境的色温的色温差异量为:该预设色温与当前环境的色温中的最大的色温减去该预设色温与当前环境的色温中的最小的色温。For any preset color temperature, the color temperature difference between the preset color temperature and the color temperature of the current environment is: the maximum color temperature between the preset color temperature and the color temperature of the current environment minus the minimum color temperature between the preset color temperature and the color temperature of the current environment color temperature.
在与当前环境的色温最接近的两个预设色温中的一个预设色温的第一直线的斜率和与当前环境的色温最接近的两个预设色温中的另一个预设色温的第一直线的斜率之间进行插值,得到第三斜率可以表示为:The slope of the first straight line at one of the two preset color temperatures closest to the color temperature of the current environment and the first straight line of the other of the two preset color temperatures closest to the color temperature of the current environment Interpolating between the slopes of a straight line, the third slope can be expressed as:
第三斜率=K_d1*weight_d1+K_d2*weight_d1,weight_d1=(K_d1-当前环境的色温)/(K_d1-K_d2),weight_d2=1-weight_d1;The third slope=K_d1*weight_d1+K_d2*weight_d1, weight_d1=(K_d1-the color temperature of the current environment)/(K_d1-K_d2), weight_d2=1-weight_d1;
其中,K_d1表示与当前环境的色温最接近的两个预设色温中的最大的预设色温的第一直线的斜率,K_d2表示与当前环境的色温最接近的两个预设色温中的最小的预设色温的第一直线的斜率。Among them, K_d1 represents the slope of the first straight line of the largest preset color temperature among the two preset color temperatures closest to the color temperature of the current environment, and K_d2 represents the minimum of the two preset color temperatures closest to the color temperature of the current environment The slope of the first straight line for the preset color temperature.
例如,当前环境的色温为6000k,多个预设色温包括:D75光源发出的光的色温、D65光源发出的光的色温、D50光源发出的光的色温、CWF光源发出的光的色温、TL84光源发出的光的色温、A光源发出的光的色温,与当前环境的色温最接近的两个预设色温为6500k和5000k,第三斜率=K_d65*weight_d65+K_d50*weight_d50,其中,K_d65表示6500k的第一直线的斜率,K_d50表示5000k的第一直线的斜率,weight_d50=(6500k-6000k)/(6500k-5000k),weight_d65=1-weight_d50。For example, the color temperature of the current environment is 6000k, and multiple preset color temperatures include: the color temperature of the light emitted by the D75 light source, the color temperature of the light emitted by the D65 light source, the color temperature of the light emitted by the D50 light source, the color temperature of the light emitted by the CWF light source, and the TL84 light source The color temperature of the emitted light, the color temperature of the light emitted by light source A, the two preset color temperatures closest to the color temperature of the current environment are 6500k and 5000k, the third slope=K_d65*weight_d65+K_d50*weight_d50, where K_d65 means 6500k The slope of the first straight line, K_d50 represents the slope of the first straight line of 5000k, weight_d50=(6500k-6000k)/(6500k-5000k), weight_d65=1-weight_d50.
在本申请中,当第一图像没有过度曝光时,若当前环境的色温不在预设色温区间中并且当前环境的色温大于多个预设色温中的最大的预设色温,可以将多个预设色温中的最大的预设色温的第一直线的斜率作为第三斜率。In this application, when the first image is not overexposed, if the color temperature of the current environment is not in the preset color temperature range and the color temperature of the current environment is greater than the maximum preset color temperature among the multiple preset color temperatures, multiple preset The slope of the first straight line with the maximum preset color temperature among the color temperatures is used as the third slope.
在本申请中,当第一图像没有过度曝光时,若当前环境的色温不在预设色温区间中并且当前环境的色温小于多个预设色温中的最小的预设色温,可以将多个预设色温中的最小的预设色温的第一直线的斜率作为第三斜率。In this application, when the first image is not overexposed, if the color temperature of the current environment is not in the preset color temperature range and the color temperature of the current environment is lower than the minimum preset color temperature among the multiple preset color temperatures, multiple preset The slope of the first straight line with the minimum preset color temperature among the color temperatures is used as the third slope.
在一些实施例中,第一图像没有过度曝光,第二信息为具有第四斜率的直线;还包括:当当前环境的色温与多个预设色温中的一个预设色温相同时,将该预设色温的第二直线的斜率作为第四斜率;当当前环境的色温在预设色温区间中并且不同于多个预设色温中的任意一个预设色温时,在与当前环境的色温最接近的两个预设色温中的一个预设色温的第二直线的斜率和与当前环境的色温最接近的两个预设色温中的另一个预设色温的第二直线的斜率之间进行插值,得到第四斜率;当当前环境的色温不在预设色温区间中时,将多个预设色温中的最大的预设色温的第二直线的斜率或多个预设色温中的最小的预设色温的第二直线的斜率作为所述第四斜率。In some embodiments, the first image is not overexposed, and the second information is a straight line with a fourth slope; it also includes: when the color temperature of the current environment is the same as one of the preset color temperatures, the preset Set the slope of the second straight line of the color temperature as the fourth slope; when the color temperature of the current environment is in the preset color temperature interval and is different from any preset color temperature among the preset color temperatures, the color temperature closest to the current environment Interpolation is performed between the slope of the second straight line at one of the two preset color temperatures and the slope of the second straight line at the other of the two preset color temperatures closest to the color temperature of the current environment, to obtain The fourth slope; when the color temperature of the current environment is not in the preset color temperature range, the slope of the second straight line of the largest preset color temperature among the multiple preset color temperatures or the minimum preset color temperature of the multiple preset color temperatures The slope of the second straight line is used as the fourth slope.
在本申请中,当第一图像没有过度曝光时,若当前环境的色温与多个预设色温中的一个预设色温相同时,可以将与当前环境的色温相同的预设色温的第二直线的斜率作为第四斜率。In this application, when the first image is not overexposed, if the color temperature of the current environment is the same as one of the preset color temperatures, the second straight line of the preset color temperature that is the same as the color temperature of the current environment can be The slope of is used as the fourth slope.
在本申请中,在与当前环境的色温最接近的两个预设色温中的一个预设色温的第二直线的斜率和与当前环境的色温最接近的两个预设色温中的另一个预设色温的第二直线的斜率之间进行插值,得到第四斜率可以表示为:In this application, the slope of the second straight line at one of the two preset color temperatures closest to the color temperature of the current environment and the other of the two preset color temperatures closest to the color temperature of the current environment Interpolation is performed between the slopes of the second straight line of the color temperature, and the fourth slope obtained can be expressed as:
第四斜率=K_d1’*weight_d1+K_d2’*weight_d1,weight_d1=(K_d1-当前环境的色温)/(K_d1-K_d2),weight_d2=1-weight_d1;The fourth slope=K_d1'*weight_d1+K_d2'*weight_d1, weight_d1=(K_d1-the color temperature of the current environment)/(K_d1-K_d2), weight_d2=1-weight_d1;
其中,K_d1’表示与当前环境的色温最接近的两个预设色温中的最大的预设色温的第二直线的斜率,K_d2’表示与当前环境的色温最接近的两个预设色温中的最小的预设色温的第二直线的斜率。Among them, K_d1' represents the slope of the second straight line of the largest preset color temperature among the two preset color temperatures closest to the color temperature of the current environment, and K_d2' represents the slope of the second straight line of the two preset color temperatures closest to the color temperature of the current environment. The slope of the second line for the minimum preset color temperature.
在本申请中,当第一图像没有过度曝光时,若当前环境的色温不在预设色温区间中并且当前环境的色温大于多个预设色温中的最大的预设色温,可以将多个预设色温中的最大的预设色温的第二直线的斜率作为第四斜率。In this application, when the first image is not overexposed, if the color temperature of the current environment is not in the preset color temperature range and the color temperature of the current environment is greater than the maximum preset color temperature among the multiple preset color temperatures, multiple preset The slope of the second straight line with the maximum preset color temperature among the color temperatures is used as the fourth slope.
在本申请中,当第一图像没有过度曝光时,若当前环境的色温不在预设色温区间中并且当前环境的色温小于多个预设色温中的最小的预设色温,可以将多个预设色温中的最小的预设色温的第二直线的斜率作为第四斜率。In this application, when the first image is not overexposed, if the color temperature of the current environment is not in the preset color temperature range and the color temperature of the current environment is lower than the minimum preset color temperature among the multiple preset color temperatures, multiple preset The slope of the second straight line with the minimum preset color temperature among the color temperatures is used as the fourth slope.
在一些实施例中,还包括:当第二图像的亮度与预设目标图像亮度的亮度差异量大于差异量阈值时,基于第三信息,确定当前环境的检测亮度对应的第二校正亮度,其中,第二图像为目标相机传感器在将目标相机传感器的曝光时间调整为所述第一曝光时间,将目标相机传感器的曝光增益调整为第一曝光增益之后采集的图像,第三信息指示在当前环境的色温下,检测亮度与校正亮度的对应关系;基于第二校正亮度、第四信息、预设目标图像亮度与所述标定图像亮度的比例,确定第二灵敏度,以及基于第二灵敏度,确定第二曝光时间和第二曝光增益,其中,第四信息指示在当前环境的色温和所述标定图像亮度下,校正亮度与灵敏度的对应关系;将目标相机传感器的曝光时间调整为第二曝光时间,将所述目标相机传感器的曝光增益调整为第二曝光增益。In some embodiments, the method further includes: when the brightness difference between the brightness of the second image and the preset target image brightness is greater than the difference threshold, based on the third information, determining the second corrected brightness corresponding to the detected brightness of the current environment, wherein , the second image is an image collected by the target camera sensor after adjusting the exposure time of the target camera sensor to the first exposure time and adjusting the exposure gain of the target camera sensor to the first exposure gain, and the third information indicates that in the current environment Under the color temperature, the corresponding relationship between detection brightness and corrected brightness; based on the second corrected brightness, the fourth information, the ratio of preset target image brightness to the calibration image brightness, determine the second sensitivity, and based on the second sensitivity, determine the second sensitivity Two exposure time and a second exposure gain, wherein the fourth information indicates the corresponding relationship between correction brightness and sensitivity under the color temperature and brightness of the calibration image of the current environment; the exposure time of the target camera sensor is adjusted to the second exposure time, Adjusting the exposure gain of the target camera sensor to a second exposure gain.
在本申请中,可以将采集时间在将目标相机传感器的曝光时间调整为第一曝光时间,将目标相机传感器的曝光增益调整为第一曝光增益的时刻之后并且采集时间与该时刻最近的图像作为第二图像。In this application, the acquisition time can be taken as the time when the exposure time of the target camera sensor is adjusted to the first exposure time, and the exposure gain of the target camera sensor is adjusted to the first exposure gain, and the acquisition time is the closest to the moment. second image.
在本申请中,当第二图像的亮度与预设目标图像亮度的亮度差异量大于差异量阈值时,基于第三信息,确定当前环境的检测亮度对应的第二校正亮度。In the present application, when the brightness difference between the brightness of the second image and the brightness of the preset target image is greater than the difference threshold, the second corrected brightness corresponding to the detected brightness of the current environment is determined based on the third information.
第三信息指示在当前环境的色温下,检测亮度与校正亮度的对应关系。The third information indicates the corresponding relationship between the detected brightness and the corrected brightness under the color temperature of the current environment.
第三信息可以为:第二图像对应的第一直线,第二图像对应的第一直线在检测亮度-校正亮度坐标系中。The third information may be: the first straight line corresponding to the second image, and the first straight line corresponding to the second image is in the detected brightness-corrected brightness coordinate system.
确定第二图像对应的第一直线的斜率的过程与确定第三斜率的过程同理,参考确定第三斜率的过程。The process of determining the slope of the first straight line corresponding to the second image is the same as the process of determining the third slope, refer to the process of determining the third slope.
在本申请中,当基于第三信息,确定当前环境的检测亮度对应的第二校正亮度时,可以确定第二图像对应的第一直线上的对应当前环境的点,第二图像对应的第一直线上的对应当前环境的点的横坐标值为:当前环境的检测亮度,第二图像对应的第一直线上的对应当前环境的点的纵坐标即为当前环境的检测亮度对应的第二校正亮度。In this application, when the second corrected brightness corresponding to the detected brightness of the current environment is determined based on the third information, the point corresponding to the current environment on the first straight line corresponding to the second image can be determined, and the second corrected brightness corresponding to the second image can be determined. The abscissa value of the point corresponding to the current environment on a straight line is: the detection brightness of the current environment, and the ordinate value of the point corresponding to the current environment on the first straight line corresponding to the second image is the detection brightness corresponding to the current environment. The second corrects for brightness.
在本申请中,第四信息指示在当前环境的色温和标定图像亮度下,校正亮度与灵敏度的对应关系。In the present application, the fourth information indicates the corresponding relationship between corrected brightness and sensitivity under the color temperature and calibrated image brightness of the current environment.
第四信息可以为:第二图像对应的第二直线,第二图像对应的第二直线在校正亮度-灵敏度坐标系中。The fourth information may be: a second straight line corresponding to the second image, and the second straight line corresponding to the second image is in the corrected brightness-sensitivity coordinate system.
确定第二图像对应的第二直线的斜率过程与确定第四斜率的过程同理,参考确定第四斜率的过程。The process of determining the slope of the second straight line corresponding to the second image is the same as the process of determining the fourth slope, refer to the process of determining the fourth slope.
在本申请中,当基于当前环境的检测亮度对应的第二校正亮度、第四信息、预设目标图像亮度与标定图像亮度的比例,确定第二灵敏度时,可以确定第二图像对应的第二直线上的对应当前环境的点,第二图像对应的第二直线上的对应当前环境的点的横坐标值为:当前环境的检测亮度对应的第二校正亮度,第二图像对应的第二直线上的对应当前环境的点的纵坐标为:对应当前环境的检测亮度对应的第二校正亮度的灵敏度。In this application, when the second sensitivity is determined based on the second corrected brightness corresponding to the detected brightness of the current environment, the fourth information, and the ratio of the brightness of the preset target image to the brightness of the calibrated image, the second sensitivity corresponding to the second image can be determined. The point on the straight line corresponding to the current environment, the abscissa value of the point corresponding to the current environment on the second straight line corresponding to the second image is: the second corrected brightness corresponding to the detected brightness of the current environment, the second straight line corresponding to the second image The ordinate of the point corresponding to the current environment on is: the sensitivity of the second corrected brightness corresponding to the detected brightness corresponding to the current environment.
然后,可以通过以下公式计算出第二灵敏度:Then, the second sensitivity can be calculated by the following formula:
第二灵敏度=标定_sensitivity’*True_target/标定_target;Second sensitivity = calibration_sensitivity'*True_target/calibration_target;
其中,标定_sensitivity’表示对应当前环境的检测亮度对应的第二校正亮度的灵敏度,True_target表示预设目标图像亮度,标定_target表示标定图像亮度,True_target/标定_target表示预设目标图像亮度与标定图像亮度的比例。Among them, calibration_sensitivity' represents the sensitivity of the second corrected brightness corresponding to the detection brightness of the current environment, True_target represents the brightness of the preset target image, calibration_target represents the brightness of the calibrated image, and True_target/calibration_target represents the difference between the brightness of the preset target image and Scale the scale of image brightness.
在本申请中,第二灵敏度为第二曝光时间与第二曝光增益的乘积。当基于第二灵敏度,确定第二曝光时间和第二曝光增益时,可以从多个预设曝光时间中随机选择一个预设曝光时间,将选择的预设曝光时间作为第二曝光时间,将第二灵敏度除以第二曝光时间,得到第二曝光增益。也可以从多个预设曝光增益中随机选择一个预设曝光增益,将选择的预设曝光增益作为第二曝光增益,将第二灵敏度除以第二曝光增益,得到第二曝光时间。In the present application, the second sensitivity is the product of the second exposure time and the second exposure gain. When determining the second exposure time and the second exposure gain based on the second sensitivity, one preset exposure time can be randomly selected from a plurality of preset exposure times, and the selected preset exposure time is used as the second exposure time, and the second The second sensitivity is divided by the second exposure time to obtain a second exposure gain. It is also possible to randomly select a preset exposure gain from multiple preset exposure gains, use the selected preset exposure gain as the second exposure gain, and divide the second sensitivity by the second exposure gain to obtain the second exposure time.
在一些实施例中,还包括:将第一图像划分为多个分块,基于该多个分块中的每一个分块的比值信息,生成该每一个分块的点,该分块的比值信息包括:相应两个通道在该分块上的平均通道值的比值,其中,相应通道在该分块上的平均通道值为该分块的所有像素点在该通道的通道值的平均值,每一个分块的点在预设坐标系中;基于预设坐标系中的黑体辐射曲线,从该每一个分块的点中确定出至少一个有效点,其中,黑体辐射曲线是根据每一个预设色温的环境图像的比值信息确定的,预设色温的环境图像是在具有该预设色温的环境下采集的图像;基于至少一个有效点,确定目标点;从每一个预设色温的点中确定出与目标点距离最近的两个点,在与目标点距离最近的两个点中的一个点所属的预设色温和与目标点距离最近的两个点中的另一个点所属的预设色温之间进行插值,得到当前环境的色温,每一个预设色温的点在黑体辐射曲线上。In some embodiments, it also includes: dividing the first image into a plurality of blocks, and generating the points of each block based on the ratio information of each block in the plurality of blocks, and the ratio of the block The information includes: the ratio of the average channel value of the corresponding two channels on the block, wherein the average channel value of the corresponding channel on the block is the average value of the channel values of all pixels of the block in the channel, The points of each block are in the preset coordinate system; based on the black body radiation curve in the preset coordinate system, at least one effective point is determined from the points of each block, wherein the black body radiation curve is based on each preset Determined by the ratio information of the environmental image of the preset color temperature, the environmental image of the preset color temperature is an image collected in an environment with the preset color temperature; based on at least one effective point, determine the target point; from each point of the preset color temperature Determine the two points closest to the target point, the preset color temperature of one of the two points closest to the target point and the preset color temperature of the other point of the two points closest to the target point The color temperature is interpolated to obtain the color temperature of the current environment, and each preset color temperature point is on the blackbody radiation curve.
在本申请中,可以利用第一图像,确定当前环境的色温。可以将第一图像划分为多个分块,每一个分块的大小相同。In this application, the first image may be used to determine the color temperature of the current environment. The first image may be divided into multiple sub-blocks, each of which has the same size.
对于任意一个分块,该分块的比值信息包括:R通道在该分块上的平均通道值/G通道在该分块上的平均通道值、B通道在该分块上的平均通道值/G通道在该分块上的平均通道值。For any block, the ratio information of the block includes: the average channel value of the R channel on the block/the average channel value of the G channel on the block, the average channel value of the B channel on the block/ The average channel value of the G channel on this block.
对于任意一个分块,R通道在该分块上的平均通道值为:该分块的所有像素点的R通道值的平均值,G通道在该分块上的平均通道值为:该分块的所有像素点的G通道值的平均值,B通道在该分块上的平均通道值为:该分块的所有像素点的B通道值的平均值。For any block, the average channel value of the R channel on the block: the average value of the R channel values of all pixels in the block, the average channel value of the G channel on the block: the block The average value of the G channel values of all pixels in the block, the average channel value of the B channel on the block: the average value of the B channel values of all the pixels in the block.
对于每一个分块,该分块的点的横坐标值为:R通道在该分块上的平均通道值/G通道在该分块上的平均通道值。For each block, the abscissa value of the point of the block is: the average channel value of the R channel on the block/the average channel value of the G channel on the block.
对于每一个分块,该分块的点的纵坐标值为:B通道在该分块上的平均通道值/G通道在该分块上的平均通道值。For each block, the ordinate value of the point of the block is: the average channel value of the B channel on the block/the average channel value of the G channel on the block.
对于任意一个预设色温,该预设色温的环境图像是在具有预设色温的环境下采集的图像。For any preset color temperature, the environmental image of the preset color temperature is an image collected under an environment with the preset color temperature.
对于任意一个预设色温,该预设色温的环境图像的比值信息包括:R通道在该预设色温的环境图像上的平均通道值/G通道在该预设色温的环境图像上的平均通道值、B通道在该预设色温的环境图像上的平均通道值/G通道在该预设色温的环境图像上的平均通道值。For any preset color temperature, the ratio information of the environmental image of the preset color temperature includes: the average channel value of the R channel on the environmental image of the preset color temperature/the average channel value of the G channel on the environmental image of the preset color temperature , the average channel value of the B channel on the environment image with the preset color temperature/the average channel value of the G channel on the environment image with the preset color temperature.
对于任意一个预设色温,R通道在该预设色温的环境图像上的平均通道值为:该预设色温的环境图像的所有像素点的R通道值的平均值,G通道在该预设色温的环境图像上的平均通道值为:该预设色温的环境图像的所有像素点的G通道值的平均值,B通道在该预设色温的环境图像上的平均通道值为:该预设色温的环境图像的所有像素点的B通道值的平均值。For any preset color temperature, the average channel value of the R channel on the environmental image of the preset color temperature: the average value of the R channel values of all pixels in the environmental image of the preset color temperature, the G channel at the preset color temperature The average channel value on the environment image of the preset color temperature: the average value of the G channel value of all pixels in the environment image of the preset color temperature, the average channel value of the B channel on the environment image of the preset color temperature: the preset color temperature The average value of the B channel values of all pixels in the environment image.
为了得到黑体辐射曲线,生成多个预设色温中的每一个预设色温的点。In order to obtain the blackbody radiation curve, a point of each preset color temperature among the plurality of preset color temperatures is generated.
对于任意一个预设色温,该预设色温的点的横坐标值为:R通道在该预设色温的环境图像上的平均通道值/G通道在该预设色温的环境图像上的平均通道值。For any preset color temperature, the abscissa value of the preset color temperature point is: the average channel value of the R channel on the environmental image of the preset color temperature/the average channel value of the G channel on the environmental image of the preset color temperature .
对于任意一个预设色温,该预设色温的点的纵坐标值为:B通道在该预设色温的环境图像上的平均通道值/G通道在该预设色温的环境图像上的平均通道值。For any preset color temperature, the ordinate value of the point of the preset color temperature is: the average channel value of the B channel on the environmental image of the preset color temperature/the average channel value of the G channel on the environmental image of the preset color temperature .
每一个预设色温的点中的相邻的两个点组成一个点对。Two adjacent points among the points of each preset color temperature form a point pair.
对于每一个点对,生成该点对的直线,分别将每一个点对的直线作为黑体辐射曲线一个线段,从而,得到黑体辐射曲线。点对中的一个点作为点对的直线的一个端点,点对中的另一个点作为点对的直线的另一个端点。For each point pair, a straight line of the point pair is generated, and the straight line of each point pair is used as a line segment of the black body radiation curve, thereby obtaining the black body radiation curve. One point in the point pair is used as one endpoint of the point pair line, and the other point in the point pair is used as the other end point of the point pair line.
基于预设坐标系中的黑体辐射曲线,从每一个分块的点中确定出至少一个有效点包括:对于任意一个分块的点,确定与该分块的点距离最近的两个色温锚点之间的直线;若经过该分块的点并且垂直于该与该分块的点距离最近的两个色温锚点之间的直线的线段的长度小于阈值,则该分块的点为一个有效点。Based on the black body radiation curve in the preset coordinate system, determining at least one effective point from each block point includes: for any block point, determining two color temperature anchor points closest to the block point The straight line between; if the length of the line segment passing through the block point and perpendicular to the straight line between the two color temperature anchor points closest to the block point is less than the threshold, the block point is a valid point.
当确定出一个有效点时,将一个有效点作为目标点。当确定出多个有效点时,可以通过以下步骤确定目标点:计算多个有效点的横坐标值的平均值,将多个有效点的横坐标值的平均值作为目标点的横坐标值;计算多个有效点的纵坐标值的平均值,将多个有效点的纵坐标值的平均值作为目标点的纵坐标值。When an effective point is determined, an effective point is taken as a target point. When a plurality of effective points are determined, the target point can be determined through the following steps: calculate the average value of the abscissa values of the multiple effective points, and use the average value of the abscissa values of the multiple effective points as the abscissa value of the target point; Calculate the average value of the ordinate values of multiple effective points, and use the average value of the ordinate values of the multiple effective points as the ordinate value of the target point.
从每一个预设色温的点中确定出与目标点距离最近的两个点。按照预设色温的点与目标点的距离从小至大,对每一个预设色温的点进行排序,前两个预设色温的点即为与目标点距离最近的两个点。Determine the two points closest to the target point from each preset color temperature point. The points of each preset color temperature are sorted according to the distance between the preset color temperature point and the target point from small to large, and the first two preset color temperature points are the two points closest to the target point.
在与目标点距离最近的两个点中的一个点所属的预设色温和与目标点距离最近的两个点中的另一个点所属的预设色温之间进行插值,得到当前环境的色温可以表示为:Interpolation is performed between the preset color temperature of one of the two points closest to the target point and the preset color temperature of the other of the two points closest to the target point, and the color temperature of the current environment can be obtained Expressed as:
当前环境的色温=(预设色温1*预设色温1的权重)+(预设色温2*预设色温2的权重);The color temperature of the current environment = (preset color temperature 1*weight of preset color temperature 1)+(preset color temperature 2*weight of preset color temperature 2);
其中,预设色温1为与目标点距离最近的两个点中的与目标点距离最近的点所属的预设色温,预设色温2为与目标点距离最近的两个点中的与目标点距离最远的点所属的预设色温,预设色温1的权重=与目标点距离最近的两个点中的与目标点距离最近的点/与目标点距离最近的两个点中的每一个点与目标点的距离之和,预设色温2的权重=1-预设色温1的权重。Among them, the preset color temperature 1 is the preset color temperature of the point closest to the target point among the two points closest to the target point, and the preset color temperature 2 is the preset color temperature of the two points closest to the target point. The preset color temperature to which the farthest point belongs, the weight of preset color temperature 1 = the point closest to the target point among the two points closest to the target point/ each of the two points closest to the target point The sum of the distances between the point and the target point, the weight of preset color temperature 2 = 1 - the weight of preset color temperature 1.
请参考图4,其示出了本申请实施例提供的自动曝光装置的结构框图。自动曝光装置包括:第一确定单元401,第二确定单元402,第一自动曝光单元403。Please refer to FIG. 4 , which shows a structural block diagram of the automatic exposure device provided by the embodiment of the present application. The automatic exposure device includes: a
第一确定单元401被配置为基于第一图像对应的第一信息,确定当前环境的检测亮度对应的第一校正亮度,其中,所述第一图像为所述当前环境中的目标相机传感器采集的与预设目标图像亮度的亮度差异量大于差异量阈值的图像,所述第一信息是根据指示在所述预设色温下,检测亮度与校正亮度的对应关系的信息确定的;The first determining
第二确定单元402被配置为基于所述第一校正亮度、所述第一图像对应的第二信息、所述预设目标图像亮度与标定图像亮度的比例,确定第一灵敏度,以及基于所述第一灵敏度,确定第一曝光时间和第一曝光增益,其中,所述第二信息是根据指示在所述预设色温和所述标定图像亮度下,校正亮度与灵敏度的对应关系的信息确定的;The
第一自动曝光单元403被配置为将所述目标相机传感器的曝光时间调整为所述第一曝光时间,将所述目标相机传感器的曝光增益调整为所述第一曝光增益。The first
在一些实施例中,第一图像过度曝光,所述第一信息为具有第一斜率的直线;自动曝光装置还包括:In some embodiments, the first image is overexposed, and the first information is a straight line with a first slope; the automatic exposure device further includes:
第一计算单元,被配置为基于多个预设色温中的每一个预设色温的第一直线的斜率和所述每一个预设色温的预设权重,得到所述第一斜率。The first calculation unit is configured to obtain the first slope based on the slope of the first straight line of each preset color temperature of the plurality of preset color temperatures and the preset weight of each preset color temperature.
在一些实施例中,所述第二信息为具有第二斜率的直线;自动曝光装置还包括:In some embodiments, the second information is a straight line with a second slope; the automatic exposure device further includes:
第二计算单元,被配置为基于所述每一个预设色温的第二直线的斜率和所述每一个预设色温的预设权重,得到所述第二斜率。The second calculating unit is configured to obtain the second slope based on the slope of the second straight line of each preset color temperature and the preset weight of each preset color temperature.
在一些实施例中,自动曝光装置还包括:In some embodiments, the automatic exposure device also includes:
第二自动曝光单元,被配置为当第二图像的亮度与所述预设目标图像亮度的亮度差异量大于差异量阈值时,基于第三信息,确定所述当前环境的检测亮度对应的第二校正亮度,其中,所述第二图像为所述目标相机传感器在将所述目标相机传感器的曝光时间调整为所述第一曝光时间,将所述目标相机传感器的曝光增益调整为所述第一曝光增益之后采集的图像,所述第三信息指示在当前环境的色温下,检测亮度与校正亮度的对应关系;基于所述第二校正亮度、第四信息、所述预设目标图像亮度与所述标定图像亮度的比例,确定第二灵敏度,以及基于所述第二灵敏度,确定第二曝光时间和第二曝光增益,其中,所述第四信息指示在所述当前环境的色温和所述标定图像亮度下,校正亮度与灵敏度的对应关系;将所述目标相机传感器的曝光时间调整为所述第二曝光时间,将所述目标相机传感器的曝光增益调整为所述第二曝光增益。The second automatic exposure unit is configured to, when the brightness difference between the brightness of the second image and the brightness of the preset target image is greater than the difference threshold, based on the third information, determine the second corresponding to the detected brightness of the current environment. correcting brightness, wherein the second image is the target camera sensor after adjusting the exposure time of the target camera sensor to the first exposure time, adjusting the exposure gain of the target camera sensor to the first In the image collected after the exposure gain, the third information indicates the corresponding relationship between the detected brightness and the corrected brightness under the color temperature of the current environment; based on the second corrected brightness, the fourth information, the preset target image brightness and the set The ratio of the calibrated image brightness to determine a second sensitivity, and based on the second sensitivity, determine a second exposure time and a second exposure gain, wherein the fourth information indicates the color temperature of the calibration in the current environment Under image brightness, correct the corresponding relationship between brightness and sensitivity; adjust the exposure time of the target camera sensor to the second exposure time, and adjust the exposure gain of the target camera sensor to the second exposure gain.
在一些实施例中,所述第一图像没有过度曝光,所述第一信息为具有第三斜率的直线;自动曝光装置还包括:还包括:In some embodiments, the first image is not overexposed, and the first information is a straight line with a third slope; the automatic exposure device further includes: also includes:
第三计算单元,被配置为当所述当前环境的色温与多个预设色温中的一个预设色温相同时,将所述预设色温的第一直线的斜率作为所述第三斜率;当所述当前环境的色温在预设色温区间中并且不同于多个预设色温中的任意一个预设色温时,在与所述当前环境的色温最接近的两个预设色温中的一个预设色温的第一直线的斜率和所述两个预设色温中的另一个预设色温的第一直线的斜率之间进行插值,得到所述第三斜率,其中,预设色温区间是根据所述多个预设色温中的最大的预设色温和最小的预设色温确定的;当所述当前环境的色温不在预设色温区间中时,将所述最大的预设色温的第一直线的斜率或所述最小的预设色温的第一直线的斜率作为所述第三斜率。A third calculation unit configured to use the slope of the first straight line of the preset color temperature as the third slope when the color temperature of the current environment is the same as one of the preset color temperatures; When the color temperature of the current environment is in the preset color temperature interval and is different from any one of the preset color temperatures, one of the two preset color temperatures closest to the color temperature of the current environment Interpolation is performed between the slope of the first straight line of the color temperature and the slope of the first straight line of another preset color temperature among the two preset color temperatures to obtain the third slope, wherein the preset color temperature range is Determined according to the largest preset color temperature and the smallest preset color temperature among the plurality of preset color temperatures; when the color temperature of the current environment is not in the preset color temperature range, the first of the largest preset color temperature The slope of the straight line or the slope of the first straight line with the minimum preset color temperature is used as the third slope.
在一些实施例中,所述第二信息为具有第四斜率的直线;自动曝光装置还包括:In some embodiments, the second information is a straight line with a fourth slope; the automatic exposure device further includes:
第四计算单元,被配置为当所述当前环境的色温与多个预设色温中的一个预设色温相同时,将所述预设色温的第二直线的斜率作为所述第四斜率;当所述当前环境的色温在预设色温区间中并且不同于多个预设色温中的任意一个预设色温时,在与所述当前环境的色温最接近的两个预设色温中的一个预设色温的第二直线的斜率和所述两个预设色温中的另一个预设色温的第二直线的斜率之间进行插值,得到所述第四斜率;当所述当前环境的色温不在预设色温区间中时,将所述最大的预设色温的第二直线的斜率或所述最小的预设色温的第二直线的斜率作为所述第四斜率。A fourth calculation unit configured to use the slope of the second straight line of the preset color temperature as the fourth slope when the color temperature of the current environment is the same as one of the preset color temperatures; When the color temperature of the current environment is in the preset color temperature interval and is different from any one of the preset color temperatures, one of the two preset color temperatures closest to the color temperature of the current environment is preset performing interpolation between the slope of the second straight line of the color temperature and the slope of the second straight line of another preset color temperature among the two preset color temperatures to obtain the fourth slope; when the color temperature of the current environment is not at the preset In the color temperature range, the slope of the second straight line with the maximum preset color temperature or the slope of the second straight line with the minimum preset color temperature is used as the fourth slope.
在一些实施例中,自动曝光装置还包括:In some embodiments, the automatic exposure device also includes:
第五计算单元,被配置为将所述第一图像划分为多个分块,基于所述多个分块中的每一个分块的比值信息,生成所述每一个分块的点,所述分块的比值信息包括:相应两个通道在所述分块上的平均通道值的比值,其中,相应通道在所述分块上的平均通道值为所述分块的所有像素点在所述通道的通道值的平均值,每一个分块的点在预设坐标系中;基于所述预设坐标系中的黑体辐射曲线,从所述每一个分块的点中确定出至少一个有效点,其中,所述黑体辐射曲线是根据每一个预设色温的环境图像的比值信息确定的,预设色温的环境图像是在具有所述预设色温的环境下采集的图像;基于所述至少一个有效点,确定目标点;从每一个预设色温的点中确定出与所述目标点距离最近的两个点,在所述两个点中的一个点所属的预设色温和所述两个点中的另一个点所属的预设色温之间进行插值,得到所述当前环境的色温,每一个预设色温的点在所述黑体辐射曲线上。A fifth calculation unit configured to divide the first image into a plurality of blocks, and generate a point of each block based on the ratio information of each block in the plurality of blocks, the The ratio information of the block includes: the ratio of the average channel value of the corresponding two channels on the block, wherein the average channel value of the corresponding channel on the block is all pixels of the block in the The average value of the channel value of the channel, the points of each block are in the preset coordinate system; based on the black body radiation curve in the preset coordinate system, at least one effective point is determined from the points of each block , wherein, the black body radiation curve is determined according to the ratio information of each preset color temperature environment image, and the preset color temperature environment image is an image collected in an environment with the preset color temperature; based on the at least one Effective point, determine the target point; determine the two points closest to the target point from each preset color temperature point, and the preset color temperature of one of the two points belongs to the two points Interpolation is performed between the preset color temperatures to which another point of the points belongs to obtain the color temperature of the current environment, and each point of the preset color temperature is on the black body radiation curve.
本申请实施例的自动曝光装置中的各功能模块或单元用于执行上述上述自动曝光方法的步骤,具体可以参考上述自动曝光方法的相关内容。Each functional module or unit in the automatic exposure device of the embodiment of the present application is used to execute the steps of the above automatic exposure method, for details, please refer to the relevant content of the above automatic exposure method.
本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序/指令,该计算机程序/指令被处理器执行时实现上述自动曝光方法。The embodiment of the present application also provides a computer-readable storage medium, on which a computer program/instruction is stored, and when the computer program/instruction is executed by a processor, the above automatic exposure method is realized.
本申请实施例还提供了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现上述自动曝光方法。An embodiment of the present application also provides a computer program product, including computer programs/instructions, and when the computer programs/instructions are executed by a processor, the foregoing automatic exposure method is implemented.
本领域技术人员在考虑说明书及实践这里公开的申请后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。Other embodiments of the application will be readily apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any modification, use or adaptation of the application, these modifications, uses or adaptations follow the general principles of the application and include common knowledge or conventional technical means in the technical field not disclosed in the application . The specification and examples are to be considered exemplary only, with a true scope and spirit of the application indicated by the following claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It should be understood that the present application is not limited to the precise constructions which have been described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211132935.6ACN115589538A (en) | 2022-09-16 | 2022-09-16 | Automatic exposure method, electronic equipment and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211132935.6ACN115589538A (en) | 2022-09-16 | 2022-09-16 | Automatic exposure method, electronic equipment and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN115589538Atrue CN115589538A (en) | 2023-01-10 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211132935.6APendingCN115589538A (en) | 2022-09-16 | 2022-09-16 | Automatic exposure method, electronic equipment and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN115589538A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119666163A (en)* | 2025-01-20 | 2025-03-21 | 武汉天马微电子有限公司上海分公司 | Color temperature detection method, device, equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103546732A (en)* | 2013-10-18 | 2014-01-29 | 广州市浩云安防科技股份有限公司 | Image processing method and system |
| CN105208360A (en)* | 2015-09-23 | 2015-12-30 | 青岛海信移动通信技术股份有限公司 | Image preview method and device of intelligent terminal and terminal |
| CN111031257A (en)* | 2019-12-24 | 2020-04-17 | Oppo广东移动通信有限公司 | Exposure control method, terminal and storage medium |
| CN112335228A (en)* | 2019-11-22 | 2021-02-05 | 深圳市大疆创新科技有限公司 | Image processing method, image acquisition device, movable platform and storage medium |
| CN114697628A (en)* | 2022-06-01 | 2022-07-01 | 龙旗电子(惠州)有限公司 | Image acquisition method, apparatus, device, and medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103546732A (en)* | 2013-10-18 | 2014-01-29 | 广州市浩云安防科技股份有限公司 | Image processing method and system |
| CN105208360A (en)* | 2015-09-23 | 2015-12-30 | 青岛海信移动通信技术股份有限公司 | Image preview method and device of intelligent terminal and terminal |
| CN112335228A (en)* | 2019-11-22 | 2021-02-05 | 深圳市大疆创新科技有限公司 | Image processing method, image acquisition device, movable platform and storage medium |
| CN111031257A (en)* | 2019-12-24 | 2020-04-17 | Oppo广东移动通信有限公司 | Exposure control method, terminal and storage medium |
| CN114697628A (en)* | 2022-06-01 | 2022-07-01 | 龙旗电子(惠州)有限公司 | Image acquisition method, apparatus, device, and medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119666163A (en)* | 2025-01-20 | 2025-03-21 | 武汉天马微电子有限公司上海分公司 | Color temperature detection method, device, equipment and storage medium |
| Publication | Publication Date | Title |
|---|---|---|
| EP3198852B1 (en) | Image processing apparatus and control method thereof | |
| CN108734676B (en) | Image processing method and apparatus, electronic device, computer-readable storage medium | |
| US8902328B2 (en) | Method of selecting a subset from an image set for generating high dynamic range image | |
| CN110493488B (en) | Video image stabilization method, video image stabilization device and computer readable storage medium | |
| JP2021522591A (en) | How to distinguish a 3D real object from a 2D spoof of a real object | |
| CN108401457A (en) | A kind of control method of exposure, device and unmanned plane | |
| KR101510312B1 (en) | 3D face-modeling device, system and method using Multiple cameras | |
| CN113781370B (en) | Image enhancement method and device and electronic equipment | |
| CN112580434B (en) | Face false detection optimization method and system based on depth camera and face detection equipment | |
| CN108322651B (en) | Photographing method and device, electronic equipment and computer readable storage medium | |
| CN112926498B (en) | Living body detection method and device based on multichannel fusion and depth information local dynamic generation | |
| WO2019105254A1 (en) | Background blur processing method, apparatus and device | |
| CN114511608B (en) | Depth image acquisition method, device, terminal, imaging system and medium | |
| CN108616700B (en) | Image processing method and device, electronic equipment and computer readable storage medium | |
| CN103516983A (en) | Image processing device, imaging device and image processing method | |
| CN110688926B (en) | Subject detection method and device, electronic device, computer-readable storage medium | |
| WO2022193132A1 (en) | Image detection method and apparatus, and electronic device | |
| CN116797504A (en) | Image fusion method, electronic device and storage medium | |
| CN109325905B (en) | Image processing method, image processing device, computer readable storage medium and electronic apparatus | |
| CN115589538A (en) | Automatic exposure method, electronic equipment and storage medium | |
| CN112633113A (en) | Cross-camera human face living body detection method and system | |
| CN116263942A (en) | Method for adjusting image contrast, storage medium and computer program product | |
| CN116777767A (en) | Image processing method, electronic device and storage medium | |
| CN117058183A (en) | Image processing method and device based on double cameras, electronic equipment and storage medium | |
| CN114140659B (en) | Social distance monitoring method based on human body detection under unmanned aerial vehicle visual angle |
| 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 |