[go: up one dir, main page]

CN108012134B - Photographing method and apparatus, computer-readable storage medium, and computer device - Google Patents

Photographing method and apparatus, computer-readable storage medium, and computer device Download PDF

Info

Publication number
CN108012134B
CN108012134B CN201711420213.XA CN201711420213A CN108012134B CN 108012134 B CN108012134 B CN 108012134B CN 201711420213 A CN201711420213 A CN 201711420213A CN 108012134 B CN108012134 B CN 108012134B
Authority
CN
China
Prior art keywords
image
colour temperature
light source
scene
color temperature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711420213.XA
Other languages
Chinese (zh)
Other versions
CN108012134A (en
Inventor
王会朝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711420213.XA priority Critical patent/CN108012134B/en
Publication of CN108012134A publication Critical patent/CN108012134A/en
Application granted granted Critical
Publication of CN108012134B publication Critical patent/CN108012134B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control
    • 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/74Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

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

Abstract

The application discloses a shooting method. The shooting method comprises the following steps: controlling a light supplement lamp to assist in exposure so as to obtain a first image; acquiring the color temperature of a light source of a first image; determining a first color temperature of a scene according to the color temperature of a light source of the first image and the color temperature of a fill-in lamp; acquiring a second image when the light supplement lamp is turned off; acquiring the color temperature of a light source of a second image as a second color temperature of the scene; determining the equivalent color temperature of the scene according to the first color temperature and the second color temperature; and performing white balance processing on the second image according to the equivalent color temperature of the scene. The application also discloses a shooting device, a computer readable storage medium and a computer device. The shooting method and device, the computer-readable storage medium and the computer device in the embodiment of the application determine the accurate equivalent color temperature of the scene according to the first image acquired when the light supplement lamp is turned on and the second image acquired when the light supplement lamp is turned off, so that the color tone of the second image subjected to white balance processing according to the equivalent color temperature of the scene is more accurate.

Description

拍摄方法及装置、计算机可读存储介质和计算机设备Shooting method and apparatus, computer readable storage medium and computer device

技术领域technical field

本申请涉及成像技术领域,特别涉及一种拍摄方法、拍摄装置、计算机可读存储介质和计算机设备。The present application relates to the field of imaging technologies, and in particular, to a photographing method, a photographing apparatus, a computer-readable storage medium, and a computer device.

背景技术Background technique

相关技术的白平衡技术通过检测图像对应的场景的光源的色温并根据光源的色温对图像进行白平衡处理,然而,这种方式的白平衡技术可能因为检测到的光源的色温不够准确,而导致白平衡处理后的图像的色调也不准确。The white balance technology of the related art detects the color temperature of the light source of the scene corresponding to the image and performs white balance processing on the image according to the color temperature of the light source. The tones of the white-balanced image are also not accurate.

发明内容SUMMARY OF THE INVENTION

本申请的实施例提供了一种拍摄方法、拍摄装置、计算机可读存储介质和计算机设备。Embodiments of the present application provide a photographing method, a photographing apparatus, a computer-readable storage medium, and a computer device.

本申请实施方式的拍摄方法,用于计算机设备,所述计算机设备包括补光灯,所述拍摄方法包括以下步骤:The photographing method of the embodiment of the present application is used for computer equipment, and the computer equipment includes a fill light, and the photographing method includes the following steps:

控制所述补光灯辅助曝光以获取第一图像;controlling the supplementary light for auxiliary exposure to obtain a first image;

处理所述第一图像以获取所述第一图像的光源的色温;processing the first image to obtain the color temperature of the light source of the first image;

根据所述第一图像的光源的色温和所述补光灯的色温确定场景的第一色温;Determine the first color temperature of the scene according to the color temperature of the light source of the first image and the color temperature of the fill light;

在所述补光灯关闭时获取第二图像;acquiring a second image when the fill light is turned off;

处理所述第二图像以获取所述第二图像的光源的色温作为所述场景的第二色温;processing the second image to obtain the color temperature of the light source of the second image as the second color temperature of the scene;

根据所述场景的第一色温和所述场景的第二色温确定所述场景的等效色温;和determining the equivalent color temperature of the scene based on the first color temperature of the scene and the second color temperature of the scene; and

根据所述场景的等效色温对所述第二图像进行白平衡处理。White balance processing is performed on the second image according to the equivalent color temperature of the scene.

本申请实施方式的拍摄装置,用于计算机设备,所述计算机设备包括补光灯,所述拍摄装置包括:The photographing apparatus according to the embodiment of the present application is used in computer equipment, where the computer equipment includes a fill light, and the photographing apparatus includes:

控制模块,所述控制模块用于控制所述补光灯辅助曝光以获取第一图像;a control module, the control module is used to control the auxiliary exposure of the fill light to obtain the first image;

第一处理模块,所述第一处理模块用于处理所述第一图像以获取所述第一图像的光源的色温;a first processing module, the first processing module is configured to process the first image to obtain the color temperature of the light source of the first image;

第一确定模块,所述第一确定模块用于根据所述第一图像的光源的色温和所述补光灯的色温确定场景的第一色温;a first determination module, configured to determine a first color temperature of the scene according to the color temperature of the light source of the first image and the color temperature of the fill light;

获取模块,所述获取模块用于在所述补光灯关闭时获取第二图像;an acquisition module, which is used to acquire a second image when the fill light is turned off;

第二处理模块,所述第二处理模块用于处理所述第二图像以获取所述第二图像的光源的色温作为所述场景的第二色温;a second processing module, the second processing module is configured to process the second image to obtain the color temperature of the light source of the second image as the second color temperature of the scene;

第二确定模块,所述第二确定模块用于根据所述场景的第一色温和所述场景的第二色温确定所述场景的等效色温;和a second determination module configured to determine an equivalent color temperature of the scene according to the first color temperature of the scene and the second color temperature of the scene; and

第三处理模块,所述第三处理模块用于根据所述场景的等效色温对所述第二图像进行白平衡处理。A third processing module, the third processing module is configured to perform white balance processing on the second image according to the equivalent color temperature of the scene.

本申请实施方式的一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行所述拍摄方法。One or more non-volatile computer-readable storage media containing computer-executable instructions of embodiments of the present application, when executed by one or more processors, cause the processors to execute the Shooting method.

本申请实施方式的计算机设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行所述拍摄方法。A computer device according to an embodiment of the present application includes a memory and a processor, where computer-readable instructions are stored in the memory, and when the instructions are executed by the processor, the processor causes the processor to execute the shooting method.

本申请实施方式的拍摄方法及装置、计算机可读存储介质和计算机设备根据开启补光灯时采集的第一图像确定场景的第一色温,根据关闭补光灯时采集的第二图像确定场景的第二色温,并根据第一色温和第二色温确定准确的场景的等效色温,从而可以根据场景的等效色温对第二图像进行白平衡处理,进而可以使得白平衡处理后的第二图像的色调也更加准确。The photographing method and device, computer-readable storage medium, and computer equipment of the embodiments of the present application determine the first color temperature of the scene according to the first image collected when the fill light is turned on, and determine the scene's color temperature according to the second image collected when the fill light is turned off. the second color temperature, and determine the accurate equivalent color temperature of the scene according to the first color temperature The tones are also more accurate.

本申请的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the present application will be set forth, in part, from the following description, and in part will become apparent from the following description, or may be learned by practice of the present application.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1是本申请某些实施方式的拍摄方法的流程示意图。FIG. 1 is a schematic flowchart of a photographing method according to some embodiments of the present application.

图2是本申请某些实施方式的计算机设备的平面示意图。FIG. 2 is a schematic plan view of a computer device according to some embodiments of the present application.

图3是本申请某些实施方式的拍摄装置的模块示意图。FIG. 3 is a schematic block diagram of a photographing apparatus according to some embodiments of the present application.

图4是本申请某些实施方式的拍摄方法的流程示意图。FIG. 4 is a schematic flowchart of a photographing method according to some embodiments of the present application.

图5是本申请某些实施方式的拍摄装置的模块示意图。FIG. 5 is a schematic block diagram of a photographing apparatus according to some embodiments of the present application.

图6是本申请某些实施方式的拍摄场景的示意图。FIG. 6 is a schematic diagram of a shooting scene of some embodiments of the present application.

图7是本申请某些实施方式的拍摄方法的流程示意图。FIG. 7 is a schematic flowchart of a photographing method according to some embodiments of the present application.

图8是本申请某些实施方式的拍摄场景的示意图。FIG. 8 is a schematic diagram of a shooting scene of some embodiments of the present application.

图9是本申请某些实施方式的第一处理模块的模块示意图。FIG. 9 is a schematic block diagram of a first processing module of some embodiments of the present application.

图10是本申请某些实施方式的色温曲线示意图。FIG. 10 is a schematic diagram of a color temperature curve of some embodiments of the present application.

图11是本申请某些实施方式的拍摄方法的流程示意图。FIG. 11 is a schematic flowchart of a photographing method according to some embodiments of the present application.

图12是本申请某些实施方式的计算机设备的平面示意图。12 is a schematic plan view of a computer device according to some embodiments of the present application.

图13是本申请某些实施方式的拍摄装置的模块示意图。FIG. 13 is a schematic block diagram of a photographing apparatus according to some embodiments of the present application.

图14是本申请某些实施方式的拍摄方法的流程示意图。FIG. 14 is a schematic flowchart of a photographing method according to some embodiments of the present application.

图15是本申请某些实施方式的拍摄方法的流程示意图。FIG. 15 is a schematic flowchart of a photographing method according to some embodiments of the present application.

图16是本申请某些实施方式的拍摄装置的模块示意图。FIG. 16 is a schematic block diagram of a photographing apparatus according to some embodiments of the present application.

图17是本申请某些实施方式的拍摄方法的流程示意图。FIG. 17 is a schematic flowchart of a photographing method according to some embodiments of the present application.

图18是本申请某些实施方式的第一处理模块的模块示意图。FIG. 18 is a schematic block diagram of a first processing module of some embodiments of the present application.

图19是本申请某些实施方式的拍摄方法的流程示意图。FIG. 19 is a schematic flowchart of a photographing method according to some embodiments of the present application.

图20是本申请某些实施方式的第二确定模块的模块示意图。FIG. 20 is a block diagram of a second determination module of some embodiments of the present application.

图21是本申请某些实施方式的计算机设备的模块示意图。FIG. 21 is a schematic block diagram of a computer device according to some embodiments of the present application.

图22是本申请某些实施方式的图像处理电路的模块示意图。FIG. 22 is a schematic block diagram of an image processing circuit according to some embodiments of the present application.

主要元件符号说明:Description of main component symbols:

计算机设备1000、补光灯100、第一补光灯120、第二补光灯140、拍摄装置200、控制模块212、第一处理模块214、第一确定单元2142、第一处理单元2144、第二确定单元2146、第一确定模块216、获取模块218、第二处理模块222、第三确定单元2222、第二处理单元2224、第四确定单元2226、第二确定模块224、计算单元2242、判断单元2244、第五确定单元2246、进入单元2248、第三处理模块226、第一划分模块228、第一判断模块232、第二判断模块234、第一拼接模块236、第三确定模块238、第四确定模块242、第二划分模块244、第三判断模块246、第四判断模块248、第二拼接模块252、第五确定模块254、系统总线510、处理器520、存储器530、内存储器540、显示屏550、输入装置560、图像处理电路800、ISP处理器810、控制逻辑器820、摄像头830、透镜832、图像传感器834、传感器840、图像存储器850、编码器/解码器860、显示器870。Computer equipment 1000, fill light 100, first fill light 120, second fill light 140, photographing device 200, control module 212, first processing module 214, first determination unit 2142, first processing unit 2144, first Second determination unit 2146, first determination module 216, acquisition module 218, second processing module 222, third determination unit 2222, second processing unit 2224, fourth determination unit 2226, second determination module 224, calculation unit 2242, judgment unit 2244, fifth determination unit 2246, entry unit 2248, third processing module 226, first division module 228, first determination module 232, second determination module 234, first splicing module 236, third determination module 238, first Four determination module 242, second division module 244, third determination module 246, fourth determination module 248, second splicing module 252, fifth determination module 254, system bus 510, processor 520, memory 530, internal memory 540, Display screen 550 , input device 560 , image processing circuit 800 , ISP processor 810 , control logic 820 , camera 830 , lens 832 , image sensor 834 , sensor 840 , image memory 850 , encoder/decoder 860 , display 870 .

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一图像称为第二图像,且类似地,可将第二图像称为第一图像。第一图像和第二图像两者都是图像,但不是同一图像。It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, a first image could be referred to as a second image, and, similarly, a second image could be referred to as a first image, without departing from the scope of this application. Both the first image and the second image are images, but not the same image.

请参阅图1和图2,本申请实施方式的拍摄方法可以用于计算机设备1000。计算机设备1000包括补光灯100。拍摄方法包括以下步骤:Referring to FIG. 1 and FIG. 2 , the photographing method of the embodiment of the present application can be used in a computer device 1000 . Computer device 1000 includes fill light 100 . The shooting method includes the following steps:

S212:控制补光灯100辅助曝光以获取第一图像;S212: controlling the supplementary light 100 for auxiliary exposure to obtain a first image;

S214:处理第一图像以获取第一图像的光源的色温;S214: Process the first image to obtain the color temperature of the light source of the first image;

S216:根据第一图像的光源的色温和补光灯100的色温确定场景的第一色温;S216: Determine the first color temperature of the scene according to the color temperature of the light source of the first image and the color temperature of the fill light 100;

S218:在补光灯100关闭时获取第二图像;S218: Acquire a second image when the fill light 100 is turned off;

S222:处理第二图像以获取第二图像的光源的色温作为场景的第二色温;S222: Process the second image to obtain the color temperature of the light source of the second image as the second color temperature of the scene;

S224:根据场景的第一色温和场景的第二色温确定场景的等效色温;和S224: Determine the equivalent color temperature of the scene according to the first color temperature of the scene and the second color temperature of the scene; and

S226:根据场景的等效色温对第二图像进行白平衡处理。S226: Perform white balance processing on the second image according to the equivalent color temperature of the scene.

请参阅图2和图3,本申请实施方式的拍摄装置200可以用于计算机设备1000。计算机设备1000包括补光灯100。拍摄装置200包括控制模块212、第一处理模块214、第一确定模块216、获取模块218、第二处理模块222、第二确定模块224和第三处理模块226。控制模块212用于控制补光灯100辅助曝光以获取第一图像。第一处理模块214用于处理第一图像以获取第一图像的光源的色温。第一确定模块216用于根据第一图像的光源的色温和补光灯100的色温确定场景的第一色温。获取模块218用于在补光灯100关闭时获取第二图像。第二处理模块222用于处理第二图像以获取第二图像的光源的色温作为场景的第二色温。第二确定模块224用于根据场景的第一色温和场景的第二色温确定场景的等效色温。第三处理模块226用于根据场景的等效色温对第二图像进行白平衡处理。Referring to FIG. 2 and FIG. 3 , the photographing apparatus 200 according to the embodiment of the present application may be used in the computer device 1000 . Computer device 1000 includes fill light 100 . The photographing apparatus 200 includes a control module 212 , a first processing module 214 , a first determination module 216 , an acquisition module 218 , a second processing module 222 , a second determination module 224 and a third processing module 226 . The control module 212 is used to control the supplementary light 100 for auxiliary exposure to acquire the first image. The first processing module 214 is configured to process the first image to obtain the color temperature of the light source of the first image. The first determination module 216 is configured to determine the first color temperature of the scene according to the color temperature of the light source of the first image and the color temperature of the fill light 100 . The acquiring module 218 is configured to acquire the second image when the fill light 100 is turned off. The second processing module 222 is configured to process the second image to obtain the color temperature of the light source of the second image as the second color temperature of the scene. The second determining module 224 is configured to determine the equivalent color temperature of the scene according to the first color temperature of the scene and the second color temperature of the scene. The third processing module 226 is configured to perform white balance processing on the second image according to the equivalent color temperature of the scene.

本申请实施方式的拍摄方法可以由本申请实施方式的拍摄装置200实现,其中,步骤S212可以由控制模块212实现,步骤S214可以由第一处理模块214实现,步骤S216可以由第一确定模块216实现,步骤S218可以由获取模块218实现,步骤S222可以由第二处理模块222实现,步骤S224可以由第二确定模块224实现,步骤S226可以由第三处理模块226实现。The photographing method of the embodiment of the present application may be implemented by the photographing apparatus 200 of the embodiment of the present application, wherein step S212 may be implemented by the control module 212 , step S214 may be implemented by the first processing module 214 , and step S216 may be implemented by the first determination module 216 , Step S218 may be implemented by the acquiring module 218 , Step S222 may be implemented by the second processing module 222 , Step S224 may be implemented by the second determining module 224 , and Step S226 may be implemented by the third processing module 226 .

请参阅图2,本申请实施方式的拍摄装置200可以应用于本申请实施方式的计算机设备1000中,也即是说,本申请实施方式的计算机设备1000可以包括本申请实施方式的拍摄装置200。Referring to FIG. 2 , the photographing apparatus 200 of the embodiment of the present application may be applied to the computer device 1000 of the embodiment of the present application, that is, the computer device 1000 of the embodiment of the present application may include the photographing apparatus 200 of the embodiment of the present application.

本申请实施方式的拍摄方法、拍摄装置200和计算机设备1000根据开启补光灯100时采集的第一图像确定场景的第一色温,根据关闭补光灯100时采集的第二图像确定场景的第二色温,并根据第一色温和第二色温确定准确的场景的等效色温,从而可以根据场景的等效色温对第二图像进行白平衡处理,进而可以使得白平衡处理后的第二图像的色调也更加准确。The photographing method, photographing device 200 and computer equipment 1000 of the embodiments of the present application determine the first color temperature of the scene according to the first image collected when the fill light 100 is turned on, and determine the first color temperature of the scene according to the second image collected when the fill light 100 is turned off There are two color temperatures, and the accurate equivalent color temperature of the scene is determined according to the first color temperature and the second color temperature, so that the white balance processing can be performed on the second image according to the equivalent color temperature of the scene, and then the white balance processing of the second image can be made. Hue is also more accurate.

在某些实施方式中,场景的色温(场景的第一色温、场景的第二色温或场景的等效色温)可以是指原有场景的色温,不包括补光灯100的色温。In some embodiments, the color temperature of the scene (the first color temperature of the scene, the second color temperature of the scene, or the equivalent color temperature of the scene) may refer to the color temperature of the original scene, excluding the color temperature of the fill light 100 .

具体地,由于白平衡算法存在一定的误差,例如在暗光环境下,现有的白平衡算法难以检测到光源,即使检测到光源,检测获得的光源的色温的准确度也比较低。因此,可以利用补光灯100来提升亮度以提高光源检测的成功率,但是由于补光灯100在提升亮度的同时一般会影响场景的色温,例如在补光灯100的色温与场景的色温相差较大时,可能导致检测到的场景的色温也不太准确。因此,可以分别在开启补光灯100时采集第一图像和在关闭补光灯100时采集第二图像,通过第一图像可以获取场景的第一色温,通过第二图像可以获取场景的第二色温,根据第一色温和第二色温即可获取较为准确的场景的等效色温。Specifically, due to certain errors in the white balance algorithm, for example, in a dark light environment, the existing white balance algorithm is difficult to detect the light source, and even if the light source is detected, the accuracy of the color temperature of the light source obtained by detection is relatively low. Therefore, the fill light 100 can be used to increase the brightness to improve the success rate of light source detection, but since the fill light 100 generally affects the color temperature of the scene while increasing the brightness, for example, when the color temperature of the fill light 100 is different from the color temperature of the scene Larger values may also result in less accurate color temperature of the detected scene. Therefore, the first image can be collected when the fill light 100 is turned on and the second image can be collected when the fill light 100 is turned off. The first color temperature of the scene can be obtained from the first image, and the second image of the scene can be obtained from the second image. Color temperature, according to the first color temperature and the second color temperature, a more accurate equivalent color temperature of the scene can be obtained.

在某些实施方式中,计算机设备1000内预存有色温和白平衡参数的对应关系,根据等效色温在色温和白平衡参数的对应关系中可以查找获得相应的白平衡参数,从而可以根据白平衡参数对图像进行白平衡处理。In some embodiments, the computer device 1000 pre-stores the corresponding relationship of color temperature and white balance parameters, and according to the equivalent color temperature, the corresponding white balance parameter can be obtained by searching in the corresponding relationship of color temperature and white balance parameter, so that the corresponding white balance parameter can be obtained according to the white balance parameter. White balance the image.

请参阅图4,在某些实施方式中,步骤S214前包括以下步骤:Referring to FIG. 4, in some embodiments, the following steps are included before step S214:

S228:将第一图像分成多个区域;S228: Divide the first image into multiple regions;

S232:根据每个区域的直方图判断区域是否为包括第一图像的光源的目标区域;S232: Determine whether the area is a target area including the light source of the first image according to the histogram of each area;

S234:判断是否存在相邻的多个目标区域;S234: Determine whether there are multiple adjacent target areas;

S236:在存在相邻的多个目标区域时将相邻的多个目标区域拼接为第一图像的光源;和S236: When there are multiple adjacent target areas, splicing the adjacent multiple target areas into a light source of the first image; and

S238:在不存在相邻的多个目标区域时将目标区域确定为第一图像的光源。S238: When there are no adjacent multiple target areas, determine the target area as the light source of the first image.

请参阅图5,在某些实施方式中,拍摄装置200包括第一划分模块228、第一判断模块232、第二判断模块234、第一拼接模块236和第三确定模块238。第一划分模块228用于将第一图像分成多个区域。第一判断模块232用于根据每个区域的直方图判断区域是否为包括第一图像的光源的目标区域。第二判断模块234用于判断是否存在相邻的多个目标区域。第一拼接模块236用于在存在相邻的多个目标区域时将相邻的多个目标区域拼接为第一图像的光源。第三确定模块238用于在不存在相邻的多个目标区域时将目标区域确定为第一图像的光源。Referring to FIG. 5 , in some embodiments, the photographing apparatus 200 includes a first dividing module 228 , a first determining module 232 , a second determining module 234 , a first splicing module 236 and a third determining module 238 . The first division module 228 is used to divide the first image into a plurality of regions. The first determination module 232 is configured to determine whether the area is a target area including the light source of the first image according to the histogram of each area. The second judging module 234 is used to judge whether there are multiple adjacent target areas. The first splicing module 236 is used for splicing the adjacent multiple target areas into a light source of the first image when there are multiple adjacent target areas. The third determining module 238 is configured to determine the target area as the light source of the first image when there are no adjacent multiple target areas.

也即是说,步骤S228可以由第一划分模块228实现,步骤S232可以由第一判断模块232实现,步骤S234可以由第二判断模块234实现,步骤S236可以由第一拼接模块236实现,步骤S238可以由第三确定模块238实现。That is to say, step S228 can be realized by the first dividing module 228, step S232 can be realized by the first judging module 232, step S234 can be realized by the second judging module 234, step S236 can be realized by the first splicing module 236, and step S236 can be realized by the first splicing module 236. S238 may be implemented by the third determination module 238 .

如此,可以确定第一图像中的光源位置。In this way, the position of the light source in the first image can be determined.

具体地,可以将第一图像分成多个区域,例如将第一图像分成64*48个区域。根据每个区域的直方图可以判断每个区域中像素值超过预设像素值P的像素的占比是否超过预设比例,预设像素值P例如是239,预设比例例如是5%,即判断每个区域中像素值超过239的像素的占比是否超过5%,像素值超过预设像素值P的像素的占比超过预设比例的对应区域为包括第一图像的光源的目标区域。在第一图像中存在目标区域时,判断是否存在相邻的多个目标区域,在存在相邻的多个目标区域时,相邻的多个目标区域属于同一个光源,因此可以将相邻的多个目标区域拼接为第一图像的光源;在不存在相邻的多个目标区域时,目标区域即可认为是第一图像的光源。因此,通过目标区域可以确定第一图像中的光源位置。Specifically, the first image may be divided into multiple regions, for example, the first image may be divided into 64*48 regions. According to the histogram of each area, it can be determined whether the proportion of pixels whose pixel value exceeds the preset pixel value P in each area exceeds the preset proportion. The preset pixel value P is, for example, 239, and the preset proportion is, for example, 5%. Determine whether the proportion of pixels with a pixel value exceeding 239 in each area exceeds 5%, and the corresponding area where the proportion of pixels with a pixel value exceeding the preset pixel value P exceeds the preset proportion is the target area including the light source of the first image. When there is a target area in the first image, it is determined whether there are multiple adjacent target areas. When there are multiple adjacent target areas, the adjacent multiple target areas belong to the same light source, so the adjacent target areas can be The multiple target areas are spliced into the light source of the first image; when there are no adjacent multiple target areas, the target area can be regarded as the light source of the first image. Therefore, the position of the light source in the first image can be determined by the target area.

请参阅图6,在一个例子中,根据每个区域的直方图可以判断区域A、区域B、区域C和区域D是包括第一图像的光源的目标区域,例如从区域A的直方图中,可以判断出区域A中像素值超过预设像素值P的像素的占比超过了预设比例,由于区域A、区域B、区域C和区域D是相邻的多个目标区域,因此可以将区域A、区域B、区域C和区域D拼接起来,从而获得较为完整的光源。Referring to FIG. 6, in one example, it can be determined that region A, region B, region C and region D are target regions including the light source of the first image according to the histogram of each region, for example, from the histogram of region A, It can be judged that the proportion of pixels whose pixel value exceeds the preset pixel value P in area A exceeds the preset ratio. Since area A, area B, area C and area D are adjacent multiple target areas, the area A, area B, area C and area D are spliced together to obtain a relatively complete light source.

请参阅图7和图8,在某些实施方式中,步骤S214包括以下步骤:Referring to FIG. 7 and FIG. 8, in some embodiments, step S214 includes the following steps:

S2142:根据第一图像的光源的中心沿径向向外的亮度分布确定高亮区域和中亮区域;S2142: Determine a highlight area and a medium brightness area according to the brightness distribution of the center of the light source of the first image along the radial direction outward;

S2144:将高亮区域的基色通道像素平均值减去中亮区域的基色通道像素平均值以确定第一图像的光源的颜色;和S2144: Subtract the average value of the base color channel pixels of the highlighted area from the average value of the base color channel pixels of the mid-bright area to determine the color of the light source of the first image; and

S2146:根据第一图像的光源的颜色确定第一图像的光源的色温。S2146: Determine the color temperature of the light source of the first image according to the color of the light source of the first image.

请参阅图8和图9,在某些实施方式中,第一处理模块214包括第一确定单元2142、第一处理单元2144和第二确定单元2146。第一确定单元2142用于根据第一图像的光源的中心沿径向向外的亮度分布确定高亮区域和中亮区域。第一处理单元2144用于将高亮区域的基色通道像素平均值减去中亮区域的基色通道像素平均值以确定第一图像的光源的颜色。第二确定单元2146用于根据第一图像的光源的颜色确定第一图像的光源的色温。Referring to FIG. 8 and FIG. 9 , in some embodiments, the first processing module 214 includes a first determination unit 2142 , a first processing unit 2144 and a second determination unit 2146 . The first determining unit 2142 is configured to determine the highlight area and the middle brightness area according to the brightness distribution of the center of the light source of the first image along the radially outward direction. The first processing unit 2144 is configured to subtract the average value of the pixels of the primary color channel in the highlighted area from the average value of the pixels of the primary color channel in the middle bright area to determine the color of the light source of the first image. The second determining unit 2146 is configured to determine the color temperature of the light source of the first image according to the color of the light source of the first image.

也即是说,步骤S2142可以由第一确定单元2142实现,步骤S2144可以由第一处理单元2144实现,步骤S2146可以由第二确定单元2146实现。That is to say, step S2142 may be implemented by the first determination unit 2142 , step S2144 may be implemented by the first processing unit 2144 , and step S2146 may be implemented by the second determination unit 2146 .

如此,可以通过高亮区域H和中亮区域M确定第一图像的光源的颜色和色温。In this way, the color and color temperature of the light source of the first image can be determined through the highlight region H and the medium brightness region M.

请再次参阅图8,在第一图像中的光源位置确定后,可以理解,第一图像中的光源的中心区域O为过曝区域,一般为大白斑,不包含光源的颜色的信息。光源的颜色可以通过高亮区域H和中亮区域M的基色通道像素平均值确定。高亮区域H可以是指光源的中心沿径向向外的亮度值处于第一亮度范围L1的像素所构成的区域,第一亮度范围L1例如为[200,239)。中亮区域M可以是指光源的中心沿径向向外的亮度值处于第二亮度范围L2的像素所构成的区域,第二亮度范围L2例如为[150,200)。需要说明的是,第一亮度范围L1和第二亮度范围L2的具体取值可以根据光源的中心O沿径向向外的亮度分布确定,例如光源的亮度衰减得比较快,可以增大第一亮度范围L1和第二亮度范围L2;例如光源的亮度衰减得比较慢,可以减小第一亮度范围L1和第二亮度范围L2。Referring to FIG. 8 again, after the position of the light source in the first image is determined, it can be understood that the central area O of the light source in the first image is an overexposed area, generally a large white spot, and does not contain information on the color of the light source. The color of the light source can be determined by the pixel average value of the primary color channel in the highlight region H and the medium brightness region M. The highlighted area H may refer to an area formed by pixels whose brightness values are in the first brightness range L1 from the center of the light source radially outward, and the first brightness range L1 is, for example, [200, 239). The medium-brightness area M may refer to an area formed by pixels whose brightness values are in the second brightness range L2 from the center of the light source radially outward, and the second brightness range L2 is, for example, [150, 200). It should be noted that the specific values of the first brightness range L1 and the second brightness range L2 can be determined according to the radially outward brightness distribution of the center O of the light source. The brightness range L1 and the second brightness range L2; for example, the brightness of the light source decays relatively slowly, and the first brightness range L1 and the second brightness range L2 can be reduced.

在某些实施方式中,基色通道是指颜色通道,例如包括R(红色)通道、Gr(绿红)通道、Gb(绿蓝)通道、B(蓝色)通道中的至少一个,在某些实施方式中,可以通过Gr通道的像素值和Gb通道的像素值获得G(绿色)通道的像素值。像素平均值可以是指多个像素值的算术平均值,多个像素值可以是高亮区域的所有像素的像素值或中亮区域的所有像素的像素值。在一个例子中,高亮区域的各个基色通道像素平均值(Ravg,Gavg,Bavg)为(200,210,220),中亮区域的各个基色通道像素平均值(Ravg,Gavg,Bavg)为(160,180,190),则光源颜色的通道(R,G,B)为(200-160,210-180,220-190),即(40,30,30)。In some embodiments, primary color channel refers to a color channel, for example including at least one of R (red) channel, Gr (green-red) channel, Gb (green-blue) channel, B (blue) channel, in some cases In an embodiment, the pixel value of the G (green) channel can be obtained by the pixel value of the Gr channel and the pixel value of the Gb channel. The pixel average value may refer to an arithmetic average value of a plurality of pixel values, and the plurality of pixel values may be pixel values of all pixels in a highlighted area or pixel values of all pixels in a medium-brightness area. In an example, the pixel average values (R avg , G avg , B avg ) of each primary color channel in the highlight area are (200, 210, 220), and the average pixel average values (R avg , G avg ) of each primary color channel in the mid-bright area are , B avg ) is (160, 180, 190), then the channel (R, G, B) of the light source color is (200-160, 210-180, 220-190), ie (40, 30, 30).

在某些实施方式中,根据光源的颜色确定光源的色温,具体可以为:根据光源的颜色、光源的颜色和光源的色温的对应关系确定光源的色温。其中,光源的颜色和光源的色温的对应关系可以是映射表和/或色温曲线。In some embodiments, determining the color temperature of the light source according to the color of the light source may specifically be: determining the color temperature of the light source according to the color of the light source, the corresponding relationship between the color of the light source and the color temperature of the light source. The corresponding relationship between the color of the light source and the color temperature of the light source may be a mapping table and/or a color temperature curve.

请参阅图10,在一个实施例中,可以在色温分别为3000K、4000K、5000K、6000K等标准灯箱下,获取图像并通过计算得到在上述不同色温下对应的光源的颜色,由此可以形成光源的颜色和色温的色温曲线,并可以将该色温曲线保存在计算机设备1000中。通过光源的颜色在色温曲线中查找即可获得对应的光源的色温。Referring to FIG. 10 , in one embodiment, in a standard light box with a color temperature of 3000K, 4000K, 5000K, 6000K, etc., an image can be acquired, and the color of the light source corresponding to the above-mentioned different color temperatures can be obtained through calculation, so that a light source can be formed. and the color temperature curve of the color and the color temperature, and the color temperature curve can be saved in the computer device 1000 . The color temperature of the corresponding light source can be obtained by looking up the color of the light source in the color temperature curve.

请参阅图11和图12,在某些实施方式中,补光灯100包括具有第一预设色温的第一补光灯120和具有第二预设色温的第二补光灯140,步骤S216前包括以下步骤:Referring to FIGS. 11 and 12 , in some embodiments, the fill light 100 includes a first fill light 120 with a first preset color temperature and a second fill light 140 with a second preset color temperature, step S216 includes the following steps:

S242:根据第一预设色温、第二预设色温、第一补光灯120的工作状态和第二补光灯140的工作状态确定补光灯100的色温。S242 : Determine the color temperature of the fill light 100 according to the first preset color temperature, the second preset color temperature, the working state of the first fill light 120 and the working state of the second fill light 140 .

请参阅图12和图13,在某些实施方式中,补光灯100包括具有第一预设色温的第一补光灯120和具有第二预设色温的第二补光灯140,拍摄装置200包括第四确定模块242。第四确定模块242用于根据第一预设色温、第二预设色温、第一补光灯120的工作状态和第二补光灯140的工作状态确定补光灯100的色温。Referring to FIGS. 12 and 13 , in some embodiments, the fill light 100 includes a first fill light 120 with a first preset color temperature and a second fill light 140 with a second preset color temperature. The photographing device 200 includes a fourth determination module 242 . The fourth determination module 242 is configured to determine the color temperature of the fill light 100 according to the first preset color temperature, the second preset color temperature, the working state of the first fill light 120 and the working state of the second fill light 140 .

也即是说,步骤S242可以由第四确定模块242实现。That is to say, step S242 may be implemented by the fourth determination module 242 .

如此,可以准确且快速地确定补光灯100的色温。In this way, the color temperature of the fill light 100 can be determined accurately and quickly.

具体地,在某些实施方式中,为了增强补光灯100的亮度和调节补光灯100的色温,补光灯100可以包括具有第一预设色温的第一补光灯和具有第二预设色温的第二补光灯。通过第一补光灯120的工作状态(如工作电流、工作电压等)和第二补光灯140的工作状态可以确定第一补光灯120的亮度和第二补光灯140的亮度。根据第一预设色温、第二预设色温、第一补光灯120的亮度和第二补光灯140的亮度可以确定补光灯100的色温(即第一补光灯120和第二补光灯140的综合色温),根据以下公式(CCT2*F1+CCT3*F2)/(F1+F2)=CCT1,其中CCT2可以为第一预设色温,F1可以为第一补光灯120的亮度,CCT3可以为第二预设色温,F2可以为第二补光灯140的亮度,CCT1可以为补光灯100的色温。Specifically, in some embodiments, in order to enhance the brightness of the fill light 100 and adjust the color temperature of the fill light 100, the fill light 100 may include a first fill light with a first preset color temperature and a second fill light with a preset color temperature. Set the color temperature of the second fill light. The brightness of the first fill light 120 and the brightness of the second fill light 140 can be determined by the working state of the first fill light 120 (eg, working current, working voltage, etc.) and the working state of the second fill light 140 . The color temperature of the fill light 100 can be determined according to the first preset color temperature, the second preset color temperature, the brightness of the first fill light 120 and the brightness of the second fill light 140 (ie, the first fill light 120 and the second fill light 140). The comprehensive color temperature of the light 140), according to the following formula (CCT2*F1+CCT3*F2)/(F1+F2)=CCT1, wherein CCT2 can be the first preset color temperature, and F1 can be the brightness of the first fill light 120 , CCT3 may be the second preset color temperature, F2 may be the brightness of the second fill light 140 , and CCT1 may be the color temperature of the fill light 100 .

在某些实施方式中,第一预设色温和第二预设色温可以分别根据不同的第一补光灯120和第二补光灯140进行确定,例如第一预设色温为3000K,第二预设色温为5000K,或者第一预设色温为2000K,第二预设色温为8000K等。In some embodiments, the first preset color temperature and the second preset color temperature may be determined according to different first fill light 120 and second fill light 140, for example, the first preset color temperature is 3000K, and the second preset color temperature is 3000K. The preset color temperature is 5000K, or the first preset color temperature is 2000K, the second preset color temperature is 8000K, and so on.

在一个实施例中,第一预设色温为3000K,第二预设色温为5000K,控制第一补光灯120和第二补光灯140同时工作,并且工作时发出一致的亮度,从而获得补光灯100的色温为4000K。In one embodiment, the first preset color temperature is 3000K, the second preset color temperature is 5000K, and the first fill light 120 and the second fill light 140 are controlled to work at the same time, and emit consistent brightness during operation, so as to obtain the fill light. The color temperature of the light lamp 100 is 4000K.

在某些实施方式中,补光灯100的数量为1,则该补光灯100自身的色温即可视作补光灯100的色温。In some embodiments, the number of the fill light 100 is 1, and the color temperature of the fill light 100 can be regarded as the color temperature of the fill light 100 .

请参阅图14,在某些实施方式中,补光灯100具有第一亮度,场景具有第二亮度,步骤S216包括以下步骤:Referring to FIG. 14, in some embodiments, the fill light 100 has a first brightness, and the scene has a second brightness, and step S216 includes the following steps:

S2162:根据第一亮度、第二亮度、第一图像的光源的色温和补光灯100的色温确定场景的第一色温。S2162: Determine the first color temperature of the scene according to the first brightness, the second brightness, and the color temperature of the light source of the first image and the color temperature of the fill light 100.

请参阅图3,在某些实施方式中,补光灯100具有第一亮度,场景具有第二亮度,第一确定模块216用于根据第一亮度、第二亮度、第一图像的光源的色温和补光灯100的色温确定场景的色温。Referring to FIG. 3 , in some embodiments, the fill light 100 has a first brightness, the scene has a second brightness, and the first determining module 216 is configured to determine the color of the light source according to the first brightness, the second brightness, and the first image. The color temperature of the warm fill light 100 determines the color temperature of the scene.

也即是说,步骤S2162可以由第一确定模块216实现。That is to say, step S2162 may be implemented by the first determination module 216 .

如此,可以准确且快速地确定场景的第一色温。In this way, the first color temperature of the scene can be determined accurately and quickly.

具体地,根据第一亮度、第二亮度、第一图像的光源的色温和补光灯100的色温可以确定场景的第一色温,根据以下公式(CCT2*F1+CCT3*F2)/(F1+F2)=CCT1,其中CCT2可以为补光灯100的色温,F1可以为第一亮度,CCT3可以为场景的第一色温,F2可以为第二亮度,CCT1可以为第一图像的光源的色温,则可以获得CCT3=[CCT1*(F1+F2)-CCT2*F1]/F2。Specifically, the first color temperature of the scene can be determined according to the first brightness, the second brightness, the color temperature of the light source of the first image, and the color temperature of the fill light 100, according to the following formula (CCT2*F1+CCT3*F2)/(F1+ F2)=CCT1, wherein CCT2 may be the color temperature of the fill light 100, F1 may be the first brightness, CCT3 may be the first color temperature of the scene, F2 may be the second brightness, and CCT1 may be the color temperature of the light source of the first image, Then CCT3=[CCT1*(F1+F2)-CCT2*F1]/F2 can be obtained.

在某些实施方式中,第一亮度可以由补光灯100的亮度确定,例如在补光灯100包括第一补光灯120和第二补光灯140时,补光灯100的亮度(第一亮度)为第一补光灯120的亮度和第二补光灯140的亮度的总合。在补光灯100的数量为1时,补光灯100自身的亮度即可视作第一亮度。In some embodiments, the first brightness may be determined by the brightness of the fill light 100. For example, when the fill light 100 includes the first fill light 120 and the second fill light 140, the brightness of the fill light 100 (No. A brightness) is the sum of the brightness of the first fill light 120 and the brightness of the second fill light 140 . When the number of the fill light 100 is 1, the brightness of the fill light 100 itself can be regarded as the first brightness.

在某些实施方式中,可以在补光灯100不工作的情况下,获取环境图像,通过处理环境图像可以获取第二亮度,例如计算环境图像的所有像素的平均亮度作为第二亮度。In some embodiments, the ambient image may be acquired when the fill light 100 does not work, and the second brightness may be acquired by processing the ambient image, for example, calculating the average brightness of all pixels of the ambient image as the second brightness.

在某些实施方式中,计算机设备1000可以包括测光元件,测光元件例如是硒光电管、硫化镉光敏电阻、硅光电二极管、磷砷化镓光电二极管等,通过测光元件工作可以获取第二亮度。In some embodiments, the computer device 1000 may include a photometric element, such as a selenium photocell, a cadmium sulfide photoresistor, a silicon photodiode, a gallium arsenide phosphide photodiode, and the like. Two brightness.

请参阅图15,在某些实施方式中,步骤S222前包括以下步骤:Referring to FIG. 15, in some embodiments, the following steps are included before step S222:

S244:将第二图像分成多个区域;S244: Divide the second image into multiple regions;

S246:根据每个区域的直方图判断区域是否为包括第二图像的光源的目标区域;S246: Determine whether the area is a target area including the light source of the second image according to the histogram of each area;

S248:判断是否存在相邻的多个目标区域;S248: Determine whether there are multiple adjacent target areas;

S252:在存在相邻的多个目标区域时将相邻的多个目标区域拼接为第二图像的光源;和S252: When there are multiple adjacent target areas, splicing the adjacent multiple target areas into a light source for the second image; and

S254:在不存在相邻的多个目标区域时将目标区域确定为第二图像的光源。S254: When there are no adjacent multiple target areas, determine the target area as the light source of the second image.

请参阅图16,在某些实施方式中,拍摄装置200包括第二划分模块244、第三判断模块246、第四判断模块248、第二拼接模块252和第五确定模块254。第二划分模块244用于将第二图像分成多个区域。第三判断模块246用于根据每个区域的直方图判断区域是否为包括第二图像的光源的目标区域。第四判断模块248用于判断是否存在相邻的多个目标区域。第二拼接模块252用于在存在相邻的多个目标区域时将相邻的多个目标区域拼接为第二图像的光源。第五确定模块254用于在不存在相邻的多个目标区域时将目标区域确定为第二图像的光源。Referring to FIG. 16 , in some embodiments, the photographing device 200 includes a second dividing module 244 , a third determining module 246 , a fourth determining module 248 , a second splicing module 252 and a fifth determining module 254 . The second division module 244 is used to divide the second image into a plurality of regions. The third judging module 246 is configured to judge whether the area is a target area including the light source of the second image according to the histogram of each area. The fourth judging module 248 is used to judge whether there are multiple adjacent target areas. The second splicing module 252 is used for splicing the adjacent multiple target areas into a light source of the second image when there are multiple adjacent target areas. The fifth determination module 254 is configured to determine the target area as the light source of the second image when there are no adjacent multiple target areas.

也即是说,步骤S244可以由第二划分模块244实现,步骤S246可以由第三判断模块246实现,步骤S248可以由第四判断模块248实现,步骤S252可以由第二拼接模块252实现,步骤S254可以由第五确定模块254实现。That is to say, step S244 can be realized by the second dividing module 244, step S246 can be realized by the third judging module 246, step S248 can be realized by the fourth judging module 248, step S252 can be realized by the second splicing module 252, and step S248 can be realized by the second splicing module 252. S254 may be implemented by the fifth determination module 254 .

如此,可以确定第二图像中的光源位置。In this way, the position of the light source in the second image can be determined.

在某些实施方式中,确定第二图像中的光源位置的方法与上述确定第一图像中的光源位置的方法类似,在此不做赘述。In some embodiments, the method for determining the position of the light source in the second image is similar to the method for determining the position of the light source in the first image described above, and details are not described herein.

请参阅图17,在某些实施方式中,步骤S222包括以下步骤:Referring to FIG. 17, in some embodiments, step S222 includes the following steps:

S2222:根据第二图像的光源的中心沿径向向外的亮度分布确定高亮区域和中亮区域;S2222: Determine the highlight area and the middle brightness area according to the brightness distribution of the center of the light source of the second image along the radially outward;

S2224:将高亮区域的基色通道像素平均值减去中亮区域的基色通道像素平均值以确定第二图像的光源的颜色;和S2224: subtracting the average value of the base color channel pixels of the highlighted area from the average value of the base color channel pixels of the middle bright area to determine the color of the light source of the second image; and

S2226:根据第二图像的光源的颜色确定第二图像的光源的色温。S2226: Determine the color temperature of the light source of the second image according to the color of the light source of the second image.

请参阅图18,在某些实施方式中,第二处理模块222包括第三确定单元2222、第二处理单元2224和第四确定单元2226。第三确定单元2222用于根据第二图像的光源的中心沿径向向外的亮度分布确定高亮区域和中亮区域。第二处理单元2224用于将高亮区域的基色通道像素平均值减去中亮区域的基色通道像素平均值以确定第二图像的光源的颜色。第四确定单元2226用于根据第二图像的光源的颜色确定第二图像的光源的色温。Referring to FIG. 18 , in some embodiments, the second processing module 222 includes a third determination unit 2222 , a second processing unit 2224 and a fourth determination unit 2226 . The third determining unit 2222 is configured to determine the highlight area and the medium brightness area according to the brightness distribution of the center of the light source of the second image along the radially outward direction. The second processing unit 2224 is configured to subtract the average value of the pixels of the primary color channel in the highlighted area from the average value of the pixels of the primary color channel in the highlighted area to determine the color of the light source of the second image. The fourth determining unit 2226 is configured to determine the color temperature of the light source of the second image according to the color of the light source of the second image.

也即是说,步骤S2222可以由第三确定单元2222实现,步骤S2224可以由第二处理单元2224实现,步骤S2226可以由第四确定单元2226实现。That is to say, step S2222 may be implemented by the third determination unit 2222 , step S2224 may be implemented by the second processing unit 2224 , and step S2226 may be implemented by the fourth determination unit 2226 .

如此,可以通过高亮区域和中亮区域确定第二图像的光源的颜色和色温。In this way, the color and color temperature of the light source of the second image can be determined through the highlighted area and the middle-bright area.

在某些实施方式中,通过高亮区域和中亮区域确定第二图像的光源的颜色和色温的方法与上述通过高亮区域和中亮区域确定第一图像的光源的颜色和色温的方法类似,在此不做赘述。In some embodiments, the method of determining the color and color temperature of the light source of the second image by using the highlighted area and the middle-bright area is similar to the above-mentioned method of determining the color and color temperature of the light source of the first image by using the highlighted area and the middle-bright area , which will not be repeated here.

请参阅图19,在某些实施方式中,步骤S224包括以下步骤:Referring to FIG. 19, in some embodiments, step S224 includes the following steps:

S2242:计算场景的第一色温和场景的第二色温的色温差值;S2242: Calculate the color temperature difference between the first color temperature of the scene and the second color temperature of the scene;

S2244:判断色温差值是否小于预设差值;S2244: Determine whether the color temperature difference value is less than the preset difference value;

S2246:在色温差值小于预设差值时,确定第一色温,或第二色温,或第一色温和第二色温的平均值作为场景的等效色温;和S2246: When the color temperature difference value is less than the preset difference value, determine the first color temperature, or the second color temperature, or the average value of the first color temperature and the second color temperature as the equivalent color temperature of the scene; and

在色温差值大于或等于预设差值时,进入步骤S212。When the color temperature difference value is greater than or equal to the preset difference value, go to step S212.

请参阅图20,在某些实施方式中,第二确定模块224包括计算单元2242、判断单元2244、第五确定单元2246和进入单元2248。计算单元2242用于计算场景的第一色温和场景的第二色温的色温差值。判断单元2244用于判断色温差值是否小于预设差值。第五确定单元2246用于在色温差值小于预设差值时,确定第一色温,或第二色温,或第一色温和第二色温的平均值作为场景的等效色温。进入单元2248用于在色温差值大于或等于预设差值时,进入控制补光灯100辅助曝光以获取第一图像的步骤。Referring to FIG. 20 , in some embodiments, the second determination module 224 includes a calculation unit 2242 , a determination unit 2244 , a fifth determination unit 2246 and an entry unit 2248 . The calculation unit 2242 is configured to calculate the color temperature difference value of the first color temperature of the scene and the second color temperature of the scene. The determination unit 2244 is used to determine whether the color temperature difference value is smaller than the preset difference value. The fifth determining unit 2246 is configured to determine the first color temperature, or the second color temperature, or the average value of the first color temperature and the second color temperature as the equivalent color temperature of the scene when the color temperature difference value is smaller than the preset difference value. The entry unit 2248 is configured to enter the step of controlling the supplementary light 100 for auxiliary exposure to acquire the first image when the color temperature difference value is greater than or equal to the preset difference value.

也即是说,步骤S2242可以由计算单元2242实现,步骤S2244可以由判断单元2244实现,步骤S2246可以由第五确定单元2246实现。That is to say, step S2242 may be implemented by the computing unit 2242 , step S2244 may be implemented by the judging unit 2244 , and step S2246 may be implemented by the fifth determining unit 2246 .

如此,可以根据场景的第一色温和场景的第二色温确定场景的等效色温。In this way, the equivalent color temperature of the scene can be determined according to the first color temperature of the scene and the second color temperature of the scene.

具体地,由于通过第一图像获取的场景的第一色温和通过第二图像获取的场景的第二色温都存在着一定的偏差,因此,可以通过计算场景的第一色温和第二色温的色温差值来确定场景的等效色温。判断色温差值是否小于预设差值,其中,预设差值可以预先设置在计算机设备1000中或由用户确定,在色温差值小于预设差值时,说明场景的第一色温和第二色温比较接近,即通过第一图像和通过第二图像两种方式获取的色温比较一致,因此第一色温和第二色温的可靠性比较高,可以直接采用场景的第一色温作为场景的等效色温,或直接采用场景的第二色温作为场景的等效色温,或直接采用场景的第一色温和第二色温的均值作为场景的等效色温。Specifically, since there is a certain deviation between the first color temperature of the scene obtained by the first image and the second color temperature of the scene obtained by the second image, the color temperature of the first color temperature and the second color temperature of the scene can be calculated by calculating difference to determine the equivalent color temperature of the scene. Determine whether the color temperature difference value is smaller than a preset difference value, wherein the preset difference value can be preset in the computer device 1000 or determined by the user, and when the color temperature difference value is smaller than the preset difference value, the first color temperature of the scene is described. The color temperature is relatively close, that is, the color temperature obtained by the first image and the second image are relatively consistent, so the reliability of the first color temperature and the second color temperature is relatively high, and the first color temperature of the scene can be directly used as the equivalent of the scene. The color temperature, or the second color temperature of the scene is directly used as the equivalent color temperature of the scene, or the average value of the first color temperature and the second color temperature of the scene is directly used as the equivalent color temperature of the scene.

在色温差值大于或等于预设差值时,说明场景的第一色温和第二色温相差较大,即通过第一图像和通过第二图像两种方式获取的色温比较不一致,因此第一色温和第二色温的可靠性比较低,因此可以进入步骤S212,从而重新执行本申请实施方式的拍摄方法以重新获取较为准确的场景的第一色温和第二色温。When the color temperature difference value is greater than or equal to the preset difference value, it means that the difference between the first color temperature and the second color temperature of the scene is relatively large, that is, the color temperatures obtained by the first image and the second image are relatively inconsistent, so the first color temperature The reliability of the temperature and the second color temperature is relatively low, so step S212 may be entered to re-execute the shooting method of the embodiment of the present application to re-acquire more accurate first color temperature and second color temperature of the scene.

在某些实施方式中,在色温差值大于或等于预设差值时,可以根据传统的白平衡算法(例如灰度世界法、动态阈值算法等)确定场景的等效色温,在此不做具体限定。In some embodiments, when the color temperature difference value is greater than or equal to the preset difference value, the equivalent color temperature of the scene can be determined according to a traditional white balance algorithm (such as a grayscale world method, a dynamic threshold algorithm, etc.), which is not done here. Specific restrictions.

上述拍摄装置200中各个模块的划分仅用于举例说明,在其他实施例中,可将拍摄装置200按照需要划分为不同的模块,以完成上述拍摄装置200的全部或部分功能。The division of each module in the above-mentioned photographing apparatus 200 is only for illustration. In other embodiments, the photographing apparatus 200 may be divided into different modules as required to complete all or part of the functions of the above-mentioned photographing apparatus 200 .

本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当计算机可执行指令被一个或多个处理器执行时,使得处理器执行以下步骤:The embodiment of the present application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the following steps:

S212:控制补光灯100辅助曝光以获取第一图像;S212: controlling the supplementary light 100 for auxiliary exposure to obtain a first image;

S214:处理第一图像以获取第一图像的光源的色温;S214: Process the first image to obtain the color temperature of the light source of the first image;

S216:根据第一图像的光源的色温和补光灯100的色温确定场景的第一色温;S216: Determine the first color temperature of the scene according to the color temperature of the light source of the first image and the color temperature of the fill light 100;

S218:在补光灯100关闭时获取第二图像;S218: Acquire a second image when the fill light 100 is turned off;

S222:处理第二图像以获取第二图像的光源的色温作为场景的第二色温;S222: Process the second image to obtain the color temperature of the light source of the second image as the second color temperature of the scene;

S224:根据场景的第一色温和场景的第二色温确定场景的等效色温;和S224: Determine the equivalent color temperature of the scene according to the first color temperature of the scene and the second color temperature of the scene; and

S226:根据场景的等效色温对第二图像进行白平衡处理。S226: Perform white balance processing on the second image according to the equivalent color temperature of the scene.

图21为一个实施例中计算机设备的内部结构示意图。如图21所示,该计算机设备1000包括通过系统总线510连接的处理器520、存储器530(例如为非易失性存储介质)、内存储器540、显示屏550和输入装置560。其中,计算机设备1000的存储器530存储有操作系统和计算机可读指令。该计算机可读指令可被处理器520执行,以实现本申请实施方式的拍摄方法。该处理器520用于提供计算和控制能力,支撑整个计算机设备1000的运行。计算机设备1000的内存储器530为存储器520中的计算机可读指令的运行提供环境。计算机设备1000的显示屏550可以是液晶显示屏或者电子墨水显示屏等,输入装置560可以是显示屏550上覆盖的触摸层,也可以是计算机设备1000外壳上设置的按键、轨迹球或触控板,也可以是外接的键盘、触控板或鼠标等。该计算机设备1000可以是手机、平板电脑、笔记本电脑、个人数字助理或穿戴式设备(例如智能手环、智能手表、智能头盔、智能眼镜)等。本领域技术人员可以理解,图21中示出的结构,仅仅是与本申请方案相关的部分结构的示意图,并不构成对本申请方案所应用于其上的计算机设备1000的限定,具体的计算机设备1000可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。FIG. 21 is a schematic diagram of the internal structure of a computer device in one embodiment. As shown in FIG. 21 , the computer device 1000 includes a processor 520 , a memory 530 (eg, a non-volatile storage medium), an internal memory 540 , a display screen 550 and an input device 560 connected through a system bus 510 . The memory 530 of the computer device 1000 stores an operating system and computer-readable instructions. The computer-readable instructions can be executed by the processor 520 to implement the photographing method of the embodiment of the present application. The processor 520 is used to provide computing and control capabilities to support the operation of the entire computer device 1000 . Internal memory 530 of computer device 1000 provides an environment for the execution of computer readable instructions in memory 520 . The display screen 550 of the computer device 1000 may be a liquid crystal display screen or an electronic ink display screen, etc., and the input device 560 may be a touch layer covered on the display screen 550 , or a button, a trackball or a touch panel provided on the shell of the computer device 1000 . It can also be an external keyboard, trackpad or mouse, etc. The computer device 1000 may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, or a wearable device (eg, a smart bracelet, a smart watch, a smart helmet, smart glasses), and the like. Those skilled in the art can understand that the structure shown in FIG. 21 is only a schematic diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 1000 to which the solution of the present application is applied. The specific computer device 1000 may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.

请参阅图22,本申请实施例的计算机设备1000中包括图像处理电路800,图像处理电路800可以利用硬件和/或软件组件实现,可包括定义ISP(Image Signal Processing,图像信号处理)管线的各种处理单元。图22为一个实施例中图像处理电路800的示意图。如图22所示,为便于说明,仅示出与本申请实施例相关的图像处理技术的各个方面。Referring to FIG. 22, the computer device 1000 in this embodiment of the present application includes an image processing circuit 800. The image processing circuit 800 may be implemented using hardware and/or software components, and may include various components that define an ISP (Image Signal Processing, image signal processing) pipeline. a processing unit. FIG. 22 is a schematic diagram of an image processing circuit 800 in one embodiment. As shown in FIG. 22 , for the convenience of description, only various aspects of the image processing technology related to the embodiments of the present application are shown.

如图22所示,图像处理电路800包括ISP处理器810(ISP处理器810可为处理器520或处理器520的一部分)和控制逻辑器820。摄像头830捕捉的图像数据首先由ISP处理器810处理,ISP处理器810对图像数据进行分析以捕捉可用于确定摄像头830的一个或多个控制参数的图像统计信息。摄像头830可包括一个或多个透镜832和图像传感器834。图像传感器834可包括色彩滤镜阵列(如Bayer滤镜),图像传感器834可获取每个成像像素捕捉的光强度和波长信息,并提供可由ISP处理器810处理的一组原始图像数据。传感器840(如陀螺仪)可基于传感器840接口类型把采集的图像处理的参数(如防抖参数)提供给ISP处理器810。传感器840接口可以为SMIA(Standard Mobile Imaging Architecture,标准移动成像架构)接口、其它串行或并行照相机接口或上述接口的组合。As shown in FIG. 22 , image processing circuit 800 includes ISP processor 810 (ISP processor 810 may be processor 520 or part of processor 520 ) and control logic 820 . Image data captured by camera 830 is first processed by ISP processor 810, which analyzes the image data to capture image statistics that can be used to determine one or more control parameters of camera 830. Camera 830 may include one or more lenses 832 and image sensor 834 . Image sensor 834 , which may include an array of color filters (eg, Bayer filters), may obtain light intensity and wavelength information captured by each imaging pixel and provide a set of raw image data that may be processed by ISP processor 810 . The sensor 840 (eg, a gyroscope) may provide the acquired image processing parameters (eg, anti-shake parameters) to the ISP processor 810 based on the sensor 840 interface type. The sensor 840 interface may be an SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above interfaces.

此外,图像传感器834也可将原始图像数据发送给传感器840,传感器840可基于传感器840接口类型把原始图像数据提供给ISP处理器810,或者传感器840将原始图像数据存储到图像存储器850中。Additionally, image sensor 834 may also send raw image data to sensor 840, which may provide raw image data to ISP processor 810 based on sensor 840 interface type, or sensor 840 may store raw image data in image memory 850.

ISP处理器810按多种格式逐个像素地处理原始图像数据。例如,每个图像像素可具有8、10、12或14比特的位深度,ISP处理器810可对原始图像数据进行一个或多个图像处理操作、收集关于图像数据的统计信息。其中,图像处理操作可按相同或不同的位深度精度进行。ISP processor 810 processes raw image data pixel by pixel in various formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the ISP processor 810 may perform one or more image processing operations on the raw image data, collecting statistical information about the image data. Among them, the image processing operations can be performed with the same or different bit depth precision.

ISP处理器810还可从图像存储器850接收图像数据。例如,传感器840接口将原始图像数据发送给图像存储器850,图像存储器850中的原始图像数据再提供给ISP处理器810以供处理。图像存储器850可为存储器530、存储器530的一部分、存储设备、或电子设备内的独立的专用存储器,并可包括DMA(Direct Memory Access,直接直接存储器存取)特征。ISP processor 810 may also receive image data from image memory 850 . For example, the sensor 840 interface sends the raw image data to the image memory 850, and the raw image data in the image memory 850 is provided to the ISP processor 810 for processing. The image memory 850 may be the memory 530, a part of the memory 530, a storage device, or an independent dedicated memory within the electronic device, and may include a DMA (Direct Memory Access) feature.

当接收到来自图像传感器834接口或来自传感器840接口或来自图像存储器850的原始图像数据时,ISP处理器810可进行一个或多个图像处理操作,如时域滤波。处理后的图像数据可发送给图像存储器850,以便在被显示之前进行另外的处理。ISP处理器810从图像存储器850接收处理数据,并对所述处理数据进行原始域中以及RGB和YCbCr颜色空间中的图像数据处理。ISP处理器810处理后的图像数据可输出给显示器870(显示器870可包括显示屏550),以供用户观看和/或由图形引擎或GPU(Graphics Processing Unit,图形处理器)进一步处理。此外,ISP处理器810的输出还可发送给图像存储器850,且显示器870可从图像存储器850读取图像数据。在一个实施例中,图像存储器850可被配置为实现一个或多个帧缓冲器。此外,ISP处理器810的输出可发送给编码器/解码器860,以便编码/解码图像数据。编码的图像数据可被保存,并在显示于显示器870设备上之前解压缩。编码器/解码器860可由CPU或GPU或协处理器实现。When receiving raw image data from the image sensor 834 interface or from the sensor 840 interface or from the image memory 850, the ISP processor 810 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 850 for additional processing before being displayed. The ISP processor 810 receives the processed data from the image memory 850 and performs image data processing on the processed data in the original domain and in the RGB and YCbCr color spaces. The image data processed by the ISP processor 810 may be output to the display 870 (the display 870 may include the display screen 550 ) for viewing by the user and/or further processing by a graphics engine or a GPU (Graphics Processing Unit). In addition, the output of the ISP processor 810 may also be sent to the image memory 850 , and the display 870 may read image data from the image memory 850 . In one embodiment, image memory 850 may be configured to implement one or more frame buffers. Additionally, the output of ISP processor 810 may be sent to encoder/decoder 860 for encoding/decoding image data. The encoded image data may be saved and decompressed prior to display on the display 870 device. The encoder/decoder 860 may be implemented by a CPU or GPU or a co-processor.

ISP处理器810确定的统计数据可发送给控制逻辑器820单元。例如,统计数据可包括自动曝光、自动白平衡、自动聚焦、闪烁检测、黑电平补偿、透镜832阴影校正等图像传感器834统计信息。控制逻辑器820可包括执行一个或多个例程(如固件)的处理元件和/或微控制器,一个或多个例程可根据接收的统计数据,确定摄像头830的控制参数及ISP处理器810的控制参数。例如,摄像头830的控制参数可包括传感器840控制参数(例如增益、曝光控制的积分时间、防抖参数等)、照相机闪光控制参数、透镜832控制参数(例如聚焦或变焦用焦距)、或这些参数的组合。ISP控制参数可包括用于自动白平衡和颜色调整(例如,在RGB处理期间)的增益水平和色彩校正矩阵,以及透镜832阴影校正参数。Statistics determined by the ISP processor 810 may be sent to the control logic 820 unit. For example, the statistics may include image sensor 834 statistics such as auto exposure, auto white balance, auto focus, flicker detection, black level compensation, lens 832 shading correction, and the like. Control logic 820 may include a processing element and/or a microcontroller that executes one or more routines (eg, firmware) that may determine control parameters for camera 830 and an ISP processor based on received statistics 810 control parameters. For example, camera 830 control parameters may include sensor 840 control parameters (eg, gain, integration time for exposure control, stabilization parameters, etc.), camera flash control parameters, lens 832 control parameters (eg, focal length for focusing or zooming), or these parameters The combination. ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (eg, during RGB processing), and lens 832 shading correction parameters.

以下为运用图22中图像处理技术实现拍摄方法的步骤:The following are the steps of implementing the photographing method using the image processing technology in Figure 22:

S212:控制补光灯100辅助曝光以获取第一图像;S212: controlling the supplementary light 100 for auxiliary exposure to obtain a first image;

S214:处理第一图像以获取第一图像的光源的色温;S214: Process the first image to obtain the color temperature of the light source of the first image;

S216:根据第一图像的光源的色温和补光灯100的色温确定场景的第一色温;S216: Determine the first color temperature of the scene according to the color temperature of the light source of the first image and the color temperature of the fill light 100;

S218:在补光灯100关闭时获取第二图像;S218: Acquire a second image when the fill light 100 is turned off;

S222:处理第二图像以获取第二图像的光源的色温作为场景的第二色温;S222: Process the second image to obtain the color temperature of the light source of the second image as the second color temperature of the scene;

S224:根据场景的第一色温和场景的第二色温确定场景的等效色温;和S224: Determine the equivalent color temperature of the scene according to the first color temperature of the scene and the second color temperature of the scene; and

S226:根据场景的等效色温对第二图像进行白平衡处理。S226: Perform white balance processing on the second image according to the equivalent color temperature of the scene.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium , when the program is executed, it may include the processes of the foregoing method embodiments. The storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or the like.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the patent of the present application. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (16)

1. a kind of image pickup method is used for computer equipment, which is characterized in that the computer equipment includes light compensating lamp, the bat Take the photograph method the following steps are included:
The light compensating lamp auxiliary exposure is controlled to obtain the first image;
The first image is handled to obtain the colour temperature of the light source of the first image;
The first colour temperature of scene is determined according to the colour temperature of the colour temperature of the light source of the first image and the light compensating lamp;
The second image is obtained when the light compensating lamp is closed;
The colour temperature of light source of second image to obtain second image is handled as the second colour temperature of the scene;
The equivalent colour temperature of the scene is determined according to the second colour temperature of the first colour temperature of the scene and the scene;With
White balance processing is carried out to second image according to the equivalent colour temperature of the scene;
The step of the equivalent colour temperature that the scene is determined according to the first colour temperature of the scene and the second colour temperature of the scene It is rapid the following steps are included:
Calculate the colour temperature difference of the first colour temperature of the scene and the second colour temperature of the scene;
Judge whether the colour temperature difference is less than preset difference value;
When the colour temperature difference is less than the preset difference value, first colour temperature or second colour temperature or described the are determined Equivalent colour temperature of the average value of color temperature and second colour temperature as the scene;With
When the colour temperature difference is greater than or equal to the preset difference value, into the light compensating lamp auxiliary exposure is controlled to obtain the The step of one image.
2. image pickup method according to claim 1, which is characterized in that the processing the first image is to obtain described Before the step of colour temperature of the light source of one image the following steps are included:
The first image is divided into multiple regions;
According to the histogram in each region judge the region whether be include the first image light source target area Domain;
Judge whether there is adjacent multiple target areas;
Adjacent multiple target areas are spliced into the first image when there are adjacent multiple target areas Light source;With
The target area is determined as to the light source of the first image when adjacent multiple target areas are not present.
3. image pickup method according to claim 1, which is characterized in that the processing the first image is to obtain described The step of colour temperature of the light source of one image the following steps are included:
The light for surrounding the first image is determined according to the Luminance Distribution of the center of the light source of the first image radially The highlight regions of the central area in source and middle bright area;
By the primary color channels pixel average of the highlight regions subtract the primary color channels pixel average of the middle bright area with Determine the color of the light source of the first image;With
The colour temperature of the light source of the first image is determined according to the color of the light source of the first image.
4. image pickup method according to claim 1, which is characterized in that the light compensating lamp includes having the first preset color temperature First light compensating lamp and the second light compensating lamp with the second preset color temperature, the colour temperature of the light source according to the first image and institute Before stating the step of the colour temperature of light compensating lamp determines the first colour temperature of scene the following steps are included:
According to first preset color temperature, second preset color temperature, the working condition of first light compensating lamp and described second The working condition of light compensating lamp determines the colour temperature of the light compensating lamp.
5. image pickup method according to claim 1, which is characterized in that the light compensating lamp has the first brightness, the scene With the second brightness, the colour temperature of the light source according to the first image and the colour temperature of the light compensating lamp determine the first of scene The step of colour temperature the following steps are included:
According to first brightness, second brightness, the first image light source colour temperature and the light compensating lamp colour temperature Determine the first colour temperature of the scene.
6. image pickup method according to claim 1, which is characterized in that the processing second image is to obtain described the Before the step of the second colour temperature of the colour temperature of the light source of two images as the scene the following steps are included:
Second image is divided into multiple regions;
According to the histogram in each region judge the region whether be include second image light source target area Domain;
Judge whether there is adjacent multiple target areas;
Adjacent multiple target areas are spliced into second image when there are adjacent multiple target areas Light source;With
The target area is determined as to the light source of second image when adjacent multiple target areas are not present.
7. image pickup method according to claim 1, which is characterized in that the processing second image is to obtain described the The step of the second colour temperature of the colour temperature of the light source of two images as the scene the following steps are included:
The light for surrounding second image is determined according to the Luminance Distribution of the center of the light source of second image radially The highlight regions of the central area in source and middle bright area;
By the primary color channels pixel average of the highlight regions subtract the primary color channels pixel average of the middle bright area with Determine the color of the light source of second image;With
The colour temperature of the light source of second image is determined according to the color of the light source of second image.
8. a kind of filming apparatus is used for computer equipment, which is characterized in that the computer equipment includes light compensating lamp, the bat Taking the photograph device includes:
Control module, the control module is for controlling the light compensating lamp auxiliary exposure to obtain the first image;
First processing module, the first processing module is for handling the first image to obtain the light source of the first image Colour temperature;
First determining module, first determining module are used for colour temperature and the light compensating lamp according to the light source of the first image Colour temperature determine the first colour temperature of scene;
Module is obtained, the acquisition module is used to obtain the second image when the light compensating lamp is closed;
Second processing module, the Second processing module is for handling second image to obtain the light source of second image Second colour temperature of the colour temperature as the scene;
Second determining module, second determining module are used for according to the first colour temperature of the scene and the second color of the scene Temperature determines the equivalent colour temperature of the scene;With
Third processing module, the third processing module is for carrying out second image according to the equivalent colour temperature of the scene White balance processing;
Second determining module includes:
Computing unit, the computing unit are used to calculate the colour temperature of the first colour temperature of the scene and the second colour temperature of the scene Difference;
Judging unit, the judging unit is for judging whether the colour temperature difference is less than preset difference value;
5th determination unit, the 5th determination unit are used to determine institute when the colour temperature difference is less than the preset difference value The average value of the first colour temperature or second colour temperature or first colour temperature and second colour temperature is stated as the scene Equivalent colour temperature;With
Into unit, the unit that enters is used for when the colour temperature difference is greater than or equal to the preset difference value, into control The step of light compensating lamp auxiliary exposure is to obtain the first image.
9. filming apparatus according to claim 8, which is characterized in that the filming apparatus includes:
First division module, first division module are used to the first image being divided into multiple regions;
First judgment module, the first judgment module are used to whether judge the region according to the histogram in each region Be include the first image light source target area;
Second judgment module, second judgment module is for judging whether there is adjacent multiple target areas;
First splicing module, first splicing module is for will be adjacent more when there are adjacent multiple target areas A target area is spliced into the light source of the first image;With
Third determining module, the third determining module are used for the mesh when adjacent multiple target areas are not present Mark region is determined as the light source of the first image.
10. filming apparatus according to claim 8, which is characterized in that the first processing module includes:
First determination unit, first determination unit are used for according to the center of the light source of the first image radially Luminance Distribution determines the highlight regions and middle bright area of the central area of the light source around the first image;
First processing units, the first processing units are used to the primary color channels pixel average of the highlight regions subtracting institute The primary color channels pixel average of middle bright area is stated to determine the color of the light source of the first image;With
Second determination unit, second determination unit are used to determine described first according to the color of the light source of the first image The colour temperature of the light source of image.
11. filming apparatus according to claim 8, which is characterized in that the light compensating lamp includes having the first preset color temperature The first light compensating lamp and the second light compensating lamp with the second preset color temperature, the filming apparatus include:
4th determining module, the 4th determining module are used for according to first preset color temperature, second preset color temperature, institute The working condition of the working condition and second light compensating lamp of stating the first light compensating lamp determines the colour temperature of the light compensating lamp.
12. filming apparatus according to claim 8, which is characterized in that the light compensating lamp has the first brightness, the scene With the second brightness, first determining module is used for according to first brightness, second brightness, the first image The colour temperature of light source and the colour temperature of the light compensating lamp determine the colour temperature of the scene.
13. filming apparatus according to claim 8, which is characterized in that the filming apparatus includes:
Second division module, second division module are used to second image being divided into multiple regions;
Third judgment module, the third judgment module are used to whether judge the region according to the histogram in each region Be include second image light source target area;
4th judgment module, the 4th judgment module is for judging whether there is adjacent multiple target areas;
Second splicing module, second splicing module is for will be adjacent more when there are adjacent multiple target areas A target area is spliced into the light source of second image;With
5th determining module, the 5th determining module are used for the mesh when adjacent multiple target areas are not present Mark region is determined as the light source of second image.
14. filming apparatus according to claim 8, which is characterized in that the Second processing module includes:
Third determination unit, the third determination unit are used for according to the center of the light source of second image radially Luminance Distribution determines the highlight regions and middle bright area of the central area of the light source around second image;
The second processing unit, described the second processing unit are used to the primary color channels pixel average of the highlight regions subtracting institute The primary color channels pixel average of middle bright area is stated with the color of the light source of determination second image;With
4th determination unit, the 4th determination unit are used to determine described second according to the color of the light source of second image The colour temperature of the light source of image.
15. a kind of non-volatile computer readable storage medium storing program for executing comprising computer executable instructions, when the computer can be held When row instruction is executed by one or more processors, so that bat described in any one of processor perform claim requirement 1 to 7 Take the photograph method.
16. a kind of computer equipment, including memory and processor, computer-readable instruction is stored in the memory, institute When stating instruction by processor execution, so that shooting side described in any one of processor perform claim requirement 1 to 7 Method.
CN201711420213.XA 2017-12-25 2017-12-25 Photographing method and apparatus, computer-readable storage medium, and computer device Active CN108012134B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711420213.XA CN108012134B (en) 2017-12-25 2017-12-25 Photographing method and apparatus, computer-readable storage medium, and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711420213.XA CN108012134B (en) 2017-12-25 2017-12-25 Photographing method and apparatus, computer-readable storage medium, and computer device

Publications (2)

Publication Number Publication Date
CN108012134A CN108012134A (en) 2018-05-08
CN108012134B true CN108012134B (en) 2019-08-02

Family

ID=62061113

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711420213.XA Active CN108012134B (en) 2017-12-25 2017-12-25 Photographing method and apparatus, computer-readable storage medium, and computer device

Country Status (1)

Country Link
CN (1) CN108012134B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10386701B1 (en) * 2018-05-29 2019-08-20 Nanning Fugui Precision Industrial Co., Ltd. Mobile device enabling collaboration with flashes of other devices and method thereof
CN109005360B (en) * 2018-06-11 2021-02-09 北京小米移动软件有限公司 Lighting method, device and computer-readable storage medium for shooting environment
US20220053121A1 (en) * 2018-09-11 2022-02-17 Profoto Aktiebolag A method, software product, camera device and system for determining artificial lighting and camera settings
EP3850425A4 (en) 2018-09-11 2022-06-08 Profoto Aktiebolag A computer implemented method and a system for coordinating taking of a picture using a camera and initiation of a flash pulse of at least one flash device
CN109302564B (en) * 2018-10-31 2021-01-08 维沃移动通信(杭州)有限公司 Shooting method and mobile terminal
CN113412451B (en) 2019-02-01 2023-05-12 保富图公司 Housing for an intermediate signal transmission unit and intermediate signal transmission unit
US11076083B2 (en) * 2019-11-19 2021-07-27 Lumileds Llc Multi-color flash with image post-processing
CN115116104B (en) * 2021-03-17 2025-04-04 华为技术有限公司 Skin detection method and device
CN113259556B (en) * 2021-05-06 2023-04-18 深圳市中诺通讯有限公司 Method, device and equipment for eliminating brightness difference and color difference in different areas and storage medium
CN114359101B (en) * 2021-12-31 2024-09-24 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic apparatus

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080231726A1 (en) * 2007-03-23 2008-09-25 Motorola, Inc. Apparatus and method for image color correction in a portable device
US7990431B2 (en) * 2008-03-14 2011-08-02 Asia Optical Co., Inc. Calculation method for the correction of white balance
KR100978675B1 (en) * 2008-07-21 2010-08-30 삼성전기주식회사 How to adjust the white balance when shooting with the flash
JP6049343B2 (en) * 2012-08-01 2016-12-21 キヤノン株式会社 Image processing apparatus, image processing method, and program
KR102157675B1 (en) * 2014-07-25 2020-09-18 삼성전자주식회사 Image photographing apparatus and methods for photographing image thereof

Also Published As

Publication number Publication date
CN108012134A (en) 2018-05-08

Similar Documents

Publication Publication Date Title
CN108012134B (en) Photographing method and apparatus, computer-readable storage medium, and computer device
CN108174172B (en) Photographing method and apparatus, computer-readable storage medium, and computer device
CN107959851B (en) Color temperature detection method and device, computer readable storage medium and computer equipment
JP5497151B2 (en) Automatic backlight detection
US20070047803A1 (en) Image processing device with automatic white balance
CN107704798B (en) Image blurring method, apparatus, computer-readable storage medium, and computer device
CN107872663B (en) Image processing method and device, computer readable storage medium and computer equipment
CN107317967B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN108174173B (en) Photographing method and apparatus, computer-readable storage medium, and computer device
CN108063926A (en) Image processing method and device, computer readable storage medium and computer device
CN108012135B (en) Image processing method and device, computer readable storage medium and computer device
CN107465903A (en) Image white balance method, device and computer-readable storage medium
CN108063934B (en) Image processing method and device, computer readable storage medium and computer device
CN108259754B (en) Image processing method and device, computer readable storage medium and computer device
CN107959843B (en) Image processing method and device, computer readable storage medium and computer device
CN107454317B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107341782A (en) Image processing method, device, computer device, and computer-readable storage medium
CN108063933B (en) Image processing method and device, computer readable storage medium and computer device
CN108156434B (en) Image processing method and apparatus, computer-readable storage medium and computer device
JP5899894B2 (en) Imaging apparatus, image processing apparatus, image processing program, and image processing method
CN107580205A (en) Method and device for adjusting white balance
CN107948619B (en) Image processing method, apparatus, computer-readable storage medium, and mobile terminal
CN107959842A (en) Image processing method and device, computer readable storage medium and computer equipment
CN107481199B (en) Image defogging method and device, storage medium and mobile terminal
CN108012133A (en) Image processing method, device, computer readable storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: Guangdong OPPO Mobile Communications Co., Ltd.

GR01 Patent grant
GR01 Patent grant