White balance synchronization method and device, electronic equipment and storage medium

文档序号:738919 发布日期:2021-04-20 浏览:17次 中文

阅读说明:本技术 白平衡同步方法及装置、电子设备和存储介质 (White balance synchronization method and device, electronic equipment and storage medium ) 是由 王琳 于 2020-12-18 设计创作,主要内容包括:本申请公开一种白平衡同步方法、白平衡同步装置、电子设备和计算机可读存储介质。白平衡同步方法包括:获取第一摄像头的第一白平衡增益实际值;根据第一白平衡增益实际值和第一查找表确定色温和色偏差值;根据色温和色偏差值确定第二摄像头的第二白平衡增益场景值。在色温和色偏差值相同时,第一摄像头和第二摄像头的白平衡表现是一致的,由于第二摄像头的第二白平衡增益场景值是通过色温和色偏差值确定的,而色温和色偏差值是根据第一摄像头的第一白平衡增益实际值确定的,因此通过第一白平衡增益实际值对第一摄像头进行白平衡处理和通过第二白平衡增益场景值对第二摄像头进行白平衡处理,能够实现第一摄像头和第二摄像头的颜色一致性。(The application discloses a white balance synchronization method, a white balance synchronization device, an electronic apparatus and a computer-readable storage medium. The white balance synchronization method comprises the following steps: acquiring a first white balance gain actual value of a first camera; determining a color temperature and color deviation value according to the first white balance gain actual value and the first lookup table; and determining a second white balance gain scene value of the second camera according to the color temperature and the color deviation value. When the color temperature and the color deviation value are the same, the white balance performance of the first camera and the white balance performance of the second camera are consistent, the second white balance gain scene value of the second camera is determined through the color temperature and the color deviation value, and the color temperature and the color deviation value are determined according to the first white balance gain actual value of the first camera, so that the white balance processing is performed on the first camera through the first white balance gain actual value and the white balance processing is performed on the second camera through the second white balance gain scene value, and the color consistency of the first camera and the second camera can be realized.)

1. A white balance synchronization method, characterized in that the white balance synchronization method comprises:

acquiring a first white balance gain actual value of a first camera;

determining a color temperature and color deviation value according to the first white balance gain actual value and a first lookup table, wherein the first lookup table comprises the first white balance gain actual value, a corresponding color temperature and a corresponding color deviation value, and a one-to-one mapping relation exists among the first white balance gain actual value, the corresponding color temperature and the corresponding color deviation value;

and determining a second white balance gain scene value of the second camera according to the color temperature and the color deviation value.

2. The white balance synchronization method according to claim 1, characterized in that the white balance synchronization method further comprises:

generating a first parameter vector according to the first white balance gain theoretical value;

generating a second parameter vector according to the first parameter vector and a first matrix, wherein the first matrix is a mapping relation of the first parameter vector and the second parameter vector;

and determining a corresponding first theoretical color temperature and a first theoretical color deviation value according to the second parameter vector to form the first lookup table.

3. The white balance synchronization method according to claim 2, characterized in that the white balance synchronization method further comprises:

acquiring a first parameter value of the first camera according to the color stimulation value of the first camera and the energy distribution of a preset light source;

acquiring a second parameter value of the standard human eye according to the color stimulus value of the standard human eye and the energy distribution of the preset light source;

and determining the first matrix according to the second parameter value of the standard human eye and the first parameter value of the first camera.

4. The white balance synchronization method according to claim 2, characterized in that the white balance synchronization method further comprises:

acquiring a first image, a first actual color temperature and a first actual color deviation value of the first camera under a preset light source;

obtaining a first white balance gain calibration value according to the first image;

determining a corresponding first white balance gain lookup value according to the first actual color temperature, the first actual color deviation value and the first lookup table;

acquiring a deviation between the first white balance gain calibration value and the first white balance gain search value and forming a first corresponding relation between the first white balance gain search value and the deviation;

performing interpolation processing on the first corresponding relation to obtain a first interpolation corresponding relation between each first white balance gain search value and the deviation;

moving the first theoretical color temperature and the first theoretical color deviation value according to the first interpolation corresponding relation to reestablish the relation between the first white balance gain theoretical value and the first theoretical color temperature and the first theoretical color deviation value so as to update the first lookup table and form a first updated lookup table;

the determining a color temperature and a color deviation value according to the first white balance gain actual value and the first lookup table includes:

and determining the color temperature and the color deviation value according to the first white balance gain actual value and the first updating lookup table.

5. The method for white balance synchronization according to claim 1, wherein the determining a second white balance gain scene value of a second camera according to the color temperature and the color deviation value specifically comprises:

and determining the second white balance gain scene value according to the color temperature, the color deviation value and a second lookup table, wherein the second lookup table comprises the second white balance gain scene value and the mapping relation between the color temperature and the color deviation value.

6. The white balance synchronization method according to claim 5, characterized in that the white balance synchronization method comprises:

generating a third parameter vector according to the second white balance gain theoretical value;

generating a fourth parameter vector according to the third parameter vector and the second matrix;

and determining a corresponding second theoretical color temperature and a second theoretical color deviation value according to the fourth parameter vector and forming a second lookup table.

7. The white balance synchronization method according to claim 6, characterized in that the white balance synchronization method comprises:

acquiring a first parameter value of the second camera according to the color stimulation value of the second camera and the energy distribution of a preset light source;

acquiring a second parameter value of the standard human eye according to the color stimulus value of the standard human eye and the energy distribution of the preset light source;

and determining the second matrix according to the second parameter value of the standard human eye and the first parameter value of the second camera.

8. The white balance synchronization method according to claim 6, characterized in that the white balance synchronization method comprises:

acquiring a second image, a second actual color temperature and a second actual color deviation value of the second camera under a preset light source;

obtaining a second white balance gain calibration value according to the second image;

determining a corresponding second white balance gain lookup value according to the second actual color temperature, the second actual color deviation value and the second lookup table;

acquiring a deviation between the second white balance gain calibration value and the second white balance gain search value and forming a second corresponding relation between the second white balance gain search value and the deviation;

performing interpolation processing on the second corresponding relation to obtain a second interpolation corresponding relation between each second white balance gain search value and the deviation;

moving the second theoretical color temperature and the second theoretical color deviation value according to the second interpolation corresponding relation to reestablish the relation between the second white balance gain theoretical value and the second theoretical color temperature and the second theoretical color deviation value so as to update the second lookup table and form a second updated lookup table;

the determining the second white balance gain scene value according to the color temperature, the color deviation value, and a second lookup table includes:

determining the second white balance gain scene value according to the color temperature, the color deviation value and the second updated look-up table.

9. The white balance synchronization method according to claim 1, characterized in that the white balance synchronization method further comprises:

processing the first white balance gain actual value by utilizing a prediction model to obtain a second white balance gain search value of a second camera;

and determining a second white balance gain value of a second camera according to the second white balance gain search value and the second white balance gain scene value.

10. The white balance synchronization method according to claim 9, characterized in that the white balance synchronization method further comprises:

acquiring a first white balance gain training set of the first camera according to the color stimulation value of the first camera, the energy distribution of a preset light source and the reflectivity of various objects;

acquiring a second white balance gain training set of the second camera according to the color stimulation value of the second camera, the energy distribution of the preset light source and the reflectivity of various objects;

and training a mapping model according to the first white balance gain training set and the second white balance gain training set so as to adjust the weight of the mapping model and obtain the prediction model.

11. The white balance synchronization method according to claim 10, characterized in that the white balance synchronization method further comprises:

acquiring a first white balance gain actual training set of the first camera under a lamp box;

acquiring a second white balance gain actual training set of the second camera under the lamp box;

the training a mapping model according to the first white balance gain training set and the second white balance gain training set to adjust the weight of the mapping model and obtain the prediction model includes:

and training the mapping model according to the first white balance gain training set, the second white balance gain training set, the first white balance gain actual training set and the second white balance gain actual training set to adjust the weight of the mapping model and obtain the prediction model.

12. A white balance synchronizing device, characterized in that the white balance synchronizing device comprises:

the first acquisition module is used for acquiring a first white balance gain actual value of a first camera;

the second determining module is used for determining color temperature and color deviation values according to the first white balance gain actual values and a first lookup table, wherein the first lookup table comprises the first white balance gain actual values and corresponding color temperature and corresponding color deviation values, and the first white balance gain actual values and the corresponding color temperature and corresponding color deviation values have a one-to-one mapping relation;

a third determining module, configured to determine a second white balance gain scene value of a second camera according to the color temperature and the color deviation value.

13. An electronic device, comprising a processor configured to: acquiring a first white balance gain actual value of a first camera; determining a color temperature and color deviation value according to the first white balance gain actual value and a first lookup table, wherein the first lookup table comprises the first white balance gain actual value, a corresponding color temperature and a corresponding color deviation value, and a one-to-one mapping relation exists among the first white balance gain actual value, the corresponding color temperature and the corresponding color deviation value; and determining a second white balance gain scene value of the second camera according to the color temperature and the color deviation value.

14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the white balance synchronization method according to any one of claims 1 to 11.

Technical Field

The present disclosure relates to the field of imaging technologies, and in particular, to a white balance synchronization method, a white balance synchronization apparatus, an electronic device, and a computer-readable storage medium.

Background

In the related art, the electronic apparatus may include a plurality of cameras, such as a main-shooting, wide-angle, tele, and the like camera. When a plurality of cameras work simultaneously, because the response curve of each camera is different, the phenomenon of color jump can occur in the zooming process, white balance is difficult to synchronize, and the color obtained by the plurality of cameras is difficult to reach consistency.

Disclosure of Invention

Embodiments of the present application provide a white balance synchronization method, a white balance synchronization apparatus, an electronic device, and a computer-readable storage medium.

The white balance synchronization method according to the embodiment of the application includes: acquiring a first white balance gain actual value of a first camera; determining a color temperature and color deviation value according to the first white balance gain actual value and a first lookup table, wherein the first lookup table comprises the first white balance gain actual value, a corresponding color temperature and a corresponding color deviation value, and a one-to-one mapping relation exists among the first white balance gain actual value, the corresponding color temperature and the corresponding color deviation value; and determining a second white balance gain scene value of the second camera according to the color temperature and the color deviation value.

The white balance synchronization device of the embodiment of the application comprises a first obtaining module, a second determining module and a third determining module. The first acquisition module is used for acquiring a first white balance gain actual value of the first camera; the second determining module is used for determining a color temperature and color deviation value according to the first white balance gain actual value and a first lookup table, wherein the first lookup table comprises the first white balance gain actual value and the corresponding color temperature and corresponding color deviation value, and a one-to-one mapping relation exists between the first white balance gain actual value and the corresponding color temperature and corresponding color deviation value; the third determining module is used for determining a second white balance gain scene value of the second camera according to the color temperature and the color deviation value.

The electronic device of the embodiment of the application comprises a processor. The processor is configured to: acquiring a first white balance gain actual value of a first camera; determining a color temperature and color deviation value according to the first white balance gain actual value and a first lookup table, wherein the first lookup table comprises the first white balance gain actual value, a corresponding color temperature and a corresponding color deviation value, and a one-to-one mapping relation exists among the first white balance gain actual value, the corresponding color temperature and the corresponding color deviation value; and determining a second white balance gain scene value of the second camera according to the color temperature and the color deviation value.

The computer-readable storage medium of the embodiments of the present application has stored thereon a computer program that, when executed by a processor, implements the steps of the white balance synchronization method described in any one of the above.

According to the white balance synchronization method, the white balance synchronization device, the electronic device and the computer readable storage medium of the embodiment of the application, when the color temperature and the color deviation value are the same, the white balance performances of the first camera and the second camera are consistent, since the second white balance gain scene value of the second camera is determined by the color temperature and the color deviation value, and the color temperature and the color deviation value are determined according to the first white balance gain actual value of the first camera, the white balance processing is performed on the first camera by the first white balance gain actual value and the white balance processing is performed on the second camera by the second white balance gain scene value, and the color consistency of the first camera and the second camera can be realized.

Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.

Drawings

The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:

FIG. 1 is a schematic flow chart diagram of a white balance synchronization method according to some embodiments of the present application;

FIG. 2 is a schematic diagram of a white balance synchronizer according to some embodiments of the present application;

FIG. 3 is a schematic plan view of an electronic device of some embodiments of the present application;

FIG. 4 is a schematic flow chart diagram of a white balance synchronization method according to some embodiments of the present application;

FIG. 5 is a schematic diagram of a first theoretical color temperature look-up table according to some embodiments of the present application;

FIG. 6 is a schematic diagram of a first theoretical color deviation value look-up table according to some embodiments of the present application;

FIG. 7 is a schematic flow chart diagram of a white balance synchronization method in accordance with certain embodiments of the present application;

FIG. 8 is a graphical illustration of values of a second parameter for a standard human eye in accordance with certain embodiments of the present application;

FIG. 9 is a schematic illustration of values of first parameters of a first camera of certain embodiments of the present application;

FIG. 10 is a schematic flow chart diagram of a white balance synchronization method in accordance with certain embodiments of the present application;

FIG. 11 is a schematic diagram of a first actual color temperature and a first actual color deviation value for a first camera in accordance with certain embodiments of the present application;

FIG. 12 is a graphical illustration of Y direction offset and Y direction offset radial basis function interpolation results for a first camera in accordance with certain embodiments of the present application;

FIG. 13 is a graphical illustration of X direction offset and X direction offset radial basis function interpolation results for a first camera in accordance with certain embodiments of the present application;

FIG. 14 is a schematic diagram of a first theoretical color temperature update look-up table according to some embodiments of the present application;

FIG. 15 is a schematic diagram of a first theoretical color deviation value update look-up table according to some embodiments of the present application;

fig. 16 to 18 are schematic flow charts of white balance synchronization methods according to some embodiments of the present application;

FIG. 19 is a graphical illustration of first parameter values for a second camera of certain embodiments of the present application;

FIG. 20 is a schematic flow chart diagram of a white balance synchronization method in accordance with certain embodiments of the present application;

FIG. 21 is a diagram illustrating a second actual color temperature and a second actual color deviation value for a second camera in accordance with certain embodiments of the present disclosure;

FIG. 22 is a graphical representation of Y direction offset and Y direction offset radial basis function interpolation results for a second camera in accordance with certain embodiments of the present application;

FIG. 23 is a graphical illustration of X direction offset and X direction offset radial basis function interpolation results for a second camera according to certain embodiments of the present application;

fig. 24 to 26 are schematic flow charts of white balance synchronization methods according to some embodiments of the present disclosure.

Detailed Description

Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.

Referring to fig. 1, a white balance synchronization method according to an embodiment of the present application includes:

01: acquiring a first white balance gain actual value of the first camera 300;

02: determining a color temperature and color deviation value according to the first white balance gain actual value and a first lookup table, wherein the first lookup table comprises the first white balance gain actual value and the corresponding color temperature and corresponding color deviation value, and a one-to-one mapping relation exists between the first white balance gain actual value and the corresponding color temperature and corresponding color deviation value;

03: a second white balance gain scene value of the second camera 400 is determined according to the color temperature and the color deviation value.

Referring to fig. 2, the white balance synchronization apparatus 100 according to the embodiment of the present application includes a first obtaining module 10, a first determining module 20, and a second determining module 30. The white balance synchronization method of the present application can be implemented by the white balance synchronization apparatus 100 of the embodiment of the present application, wherein step 01 can be implemented by the first obtaining module 10, step 02 can be implemented by the first determining module 20, and step 03 can be implemented by the second determining module 30, that is, the first obtaining module 10 is configured to obtain the first white balance gain actual value of the first camera 300. The first determining module 20 is configured to determine color temperature and color deviation values according to a first white balance gain actual value and a first lookup table, where the first lookup table includes the first white balance gain actual value and corresponding color temperature and corresponding color deviation values, and there is a one-to-one mapping relationship between the first white balance gain actual value and the corresponding color temperature and corresponding color deviation values. The second determining module 30 is configured to determine a second white balance gain scene value of the second camera 400 according to the color temperature and the color deviation value.

Referring to fig. 3, an electronic device 1000 according to an embodiment of the present application includes a processor 200. The white balance synchronization method according to the embodiment of the present application may be implemented by the electronic device 1000 according to the embodiment of the present application, wherein the steps 01, 02, and 03 may all be implemented by the processor 200, that is, the processor 200 may be configured to: acquiring a first white balance gain actual value of the first camera 300; determining a color temperature and color deviation value according to the first white balance gain actual value and a first lookup table, wherein the first lookup table comprises the first white balance gain actual value and the corresponding color temperature and corresponding color deviation value, and a one-to-one mapping relation exists between the first white balance gain actual value and the corresponding color temperature and corresponding color deviation value; a second white balance gain scene value of the second camera 400 is determined according to the color temperature and the color deviation value.

The processor 200 may be referred to as a driver board. The driver board may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc.

In some embodiments, the electronic device 1000 further comprises a first camera 300 and a second camera 400, and a housing 500, the first camera 300 and the second camera 400 being disposed on the housing 500.

The electronic device 1000 of the embodiment of the present application may be a terminal device configured with the processor 200. For example, the electronic device 1000 may include a smartphone, a camera, a tablet computer, or other terminal device. The electronic device 1000 according to the embodiment of the present application is illustrated by taking a smart phone as an example, and should not be construed as limiting the present application.

In the white balance synchronization method, the white balance synchronization device 100, and the electronic apparatus 1000 according to the embodiment of the present application, when the color temperature and the color deviation value are the same, the white balance performances of the first camera 300 and the second camera 400 are the same, since the second white balance gain scene value of the second camera 400 is determined by the color temperature and the color deviation value, and the color temperature and the color deviation value are determined according to the first white balance gain actual value of the first camera 300, the white balance processing is performed on the first camera 300 by the first white balance gain actual value and the white balance processing is performed on the second camera 400 by the second white balance gain scene value, and the color consistency of the first camera 300 and the second camera 400 can be achieved.

Specifically, after the first white balance gain actual value of the first camera 300 is obtained, the color temperature and color deviation value may be determined by using the first white balance gain actual value and a first lookup table, where the first lookup table includes a mapping relationship between the first white balance gain actual value and the color temperature and color deviation value. In this manner, when the color temperature and the color deviation value are the same, it can be considered that the white balance expressions of the first camera 300 and the second camera 400 are uniform. The mapping relation between the first white balance gain actual value and the color temperature and color deviation value can be quickly and accurately inquired through the first lookup table. Thus, the second white balance gain scene value of the second camera 400 can be determined according to the inquired color temperature and color deviation value.

Referring to fig. 4, in some embodiments, the white balance synchronization method includes:

041: generating a first parameter vector according to the first white balance gain theoretical value;

042: generating a second parameter vector according to the first parameter vector and a first matrix, wherein the first matrix is a mapping relation of the first parameter vector and the second parameter vector;

043: and determining a corresponding first theoretical color temperature and a first theoretical color deviation value according to the second parameter vector to form a first lookup table.

In some embodiments, the white balance synchronization apparatus 100 includes a first generation module, a second generation module, and a third generation module. Wherein, step 041 may be implemented by the first generation module, step 042 may be implemented by the second generation module, and step 043 may be implemented by the third generation module. That is, the first generating module is configured to generate a first parameter vector according to the first white balance gain theoretical value. The second generating module is used for generating a second parameter vector according to the first parameter vector and the first matrix, and the first matrix is a mapping relation of the first parameter vector and the second parameter vector. And the third generating module is used for determining the corresponding first theoretical color temperature and the first theoretical color deviation value to form a first lookup table according to the second parameter vector.

In some embodiments, the electronic device 1000 includes the processor 200, and step 041, step 042 and step 043 may all be implemented by the processor 200, that is, the processor 200 is configured to generate the first parameter vector according to the first white balance gain theoretical value; generating a second parameter vector according to the first parameter vector and a first matrix, wherein the first matrix is a mapping relation of the first parameter vector and the second parameter vector; and determining a corresponding first theoretical color temperature and a first theoretical color deviation value according to the second parameter vector to form a first lookup table.

In one example, the image of the first camera 300 includes various color channels, which may include: red channel (R), green channel (G), and blue channel (B). The actual values of the white balance gain in the present application may include R/G and B/G. Thus, a first lookup table with R/G abscissa and B/G ordinate can be made. The first lookup table has a width of 0.0032 per cell (bin) on the horizontal axis and a width of 0.0021 per cell (bin) on the vertical axis. The minimum value of the horizontal axis and the vertical axis is 0.2, the maximum value of the horizontal axis is 1.4, and the maximum value of the vertical axis is 0.8. Thus, a first lookup table of 376 x 286 is constructed. In some embodiments, for example, R/G is 0.2 and B/G is 0.2, G may be defined as 1, and a first parameter vector is generated according to the first white balance gain theoretical value, that is, the first parameter vector is: [ R G B ]. A second parameter vector is then generated based on the first parameter vector and the first matrix, which may be denoted by M1, i.e. the second parameter vector is: [ R G B ] M1 ═ XYZ. And finally, determining the corresponding first theoretical color temperature and the first theoretical color deviation value according to the second parameter vector and forming a first lookup table. It is worth mentioning that the first theoretical color temperature obtained by searching in the first lookup table according to the first white balance gain actual value is the color temperature in the step 02; and finding out a first theoretical color temperature deviation value in the first lookup table according to the first white balance gain actual value, wherein the first theoretical color temperature deviation value is the color deviation value in the step 02. In some embodiments, referring to fig. 5 and fig. 6, the first lookup table includes a first theoretical color temperature lookup table and a first theoretical color deviation value lookup table. Fig. 5 is a first theoretical color temperature lookup table, and fig. 6 is a first theoretical color deviation value lookup table.

It is worth mentioning that the XYZ vector obtained by the convolution of the eye tristimulus value curve and the light source can correspond to a set of color temperature and color deviation value, and the first theoretical color temperature and the first theoretical color deviation value corresponding to the second parameter vector can be determined through the corresponding relationship. In the above example, the minimum value of the horizontal axis and the vertical axis is 0.2, the maximum value of the horizontal axis is 1.4, and the maximum value of the vertical axis is 0.8, so that the probability of being a light source is relatively high in the current coordinate, and the probability of being a light source is relatively low in the other coordinates. It should be noted that the color channels of the first camera 300 include, but are not limited to, an R channel, a G channel, and a B channel, and the above-mentioned examples and specific numerical values are for convenience of describing the implementation of the present application and should not be construed as limiting the scope of the present application.

Referring to fig. 7, in some embodiments, the white balance synchronization method includes:

044: acquiring a first parameter value of the first camera 300 according to the color stimulus value of the first camera 300 and the energy distribution of a preset light source;

045: acquiring a second parameter value of the standard human eye according to the color stimulus value of the standard human eye and the energy distribution of the preset light source;

046: the first matrix is determined based on the second parameter values of the standard human eye and the first parameter values of the first camera 300.

In some embodiments, the white balance synchronization apparatus 100 includes a second acquisition module, a third acquisition module, and a first processing module. Step 044 may be implemented by the second obtaining module, step 045 may be implemented by the third obtaining module, and step 046 may be implemented by the first processing module. That is, the second obtaining module is configured to obtain the first parameter value of the first camera 300 according to the color stimulation value of the first camera 300 and the energy distribution of the preset light source. The third acquisition module is used for acquiring a second parameter value of the standard human eye according to the color stimulation value of the standard human eye and the energy distribution of the preset light source. The first processing module is configured to determine a first matrix according to the second parameter values of the standard human eye and the first parameter values of the first camera 300.

In some embodiments, the electronic device 1000 includes the processor 200, and steps 044, 045 and 046 may all be implemented by the processor 200, that is, the processor 200 is configured to obtain the first parameter value of the first camera 300 according to the color stimulus value of the first camera 300 and the energy distribution of the preset light source; acquiring a second parameter value of the standard human eye according to the color stimulus value of the standard human eye and the energy distribution of the preset light source; the first matrix is determined based on the second parameter values of the standard human eye and the first parameter values of the first camera 300.

In one example, the second parameter value of the standard human eye may be obtained by using a color stimulus value of the standard human eye and an energy distribution of the preset light source, the color stimulus value of the standard human eye may be obtained by using a three-stimulus curve of the standard human eye, and the energy distribution of the preset light source may use 318 sets of light source data. The color stimulus values of the standard human eye are convolved with 318 sets of light source data to obtain second parameter values of the standard human eye (see fig. 8). The first parameter value of the first camera 300 is obtained by performing convolution according to the color stimulus value 318 set of light source data of the first camera 300 (see fig. 9), where the first camera 300 is, for example, a main camera. Finally, a first matrix is determined based on the second parameter values of the standard human eye and the first parameter values of the first camera 300, and the first matrix may be a 3 x 3 matrix. The first parameter value of the first camera 300 is mapped to the second parameter value of the standard human eye after being processed by the first matrix.

Referring to fig. 10, in some embodiments, a white balance synchronization method includes:

051: acquiring a first image, a first actual color temperature and a first actual color deviation value of the first camera 300 under a preset light source;

052: obtaining a first white balance gain calibration value according to the first image;

053: determining a corresponding first white balance gain lookup value according to the first actual color temperature, the first actual color deviation value and the first lookup table;

054: acquiring the deviation of the first white balance gain calibration value and the first white balance gain searching value and forming a first corresponding relation between the first white balance gain searching value and the deviation;

055: performing interpolation processing on the first corresponding relation to obtain a first interpolation corresponding relation between each first white balance gain searching value and the deviation;

056: moving the first theoretical color temperature and the first theoretical color deviation value according to the first interpolation corresponding relation to reestablish the relation between the first white balance gain theoretical value and the first theoretical color temperature and the first theoretical color deviation value so as to update the first lookup table and form a first updated lookup table;

determining a color temperature and color deviation value according to the first white balance gain actual value and the first lookup table, including:

0211: and determining a color temperature and color deviation value according to the first white balance gain actual value and the first updating lookup table.

In some embodiments, the white balance synchronization apparatus 100 includes a fourth obtaining module, a fifth obtaining module, a third determining module, a sixth obtaining module, a second processing module, and a first updating module. Step 051 may be implemented by the fourth obtaining module, step 052 may be implemented by the fifth obtaining module, step 053 may be implemented by the third determining module, step 054 may be implemented by the sixth obtaining module, step 055 may be implemented by the second processing module, and step 056 may be implemented by the first updating module. That is, the fourth acquiring module is configured to acquire a first image, a first actual color temperature, and a first actual color deviation value of the first camera 300 under a preset light source. The fifth obtaining module is used for obtaining a first white balance gain calibration value according to the first image. The third determining module is used for determining a corresponding first white balance gain lookup value according to the first actual color temperature, the first actual color deviation value and the first lookup table. The sixth obtaining module is configured to obtain a deviation between the first white balance gain calibration value and the first white balance gain lookup value and form a first corresponding relationship between the first white balance gain lookup value and the deviation. The second processing module is used for carrying out interpolation processing on the first corresponding relation so as to obtain a first interpolation corresponding relation between each first white balance gain searching value and the deviation. The first updating module is used for moving the first theoretical color temperature and the first theoretical color deviation value according to the first interpolation corresponding relation so as to reestablish the relation between the first white balance gain theoretical value and the first theoretical color temperature and the first theoretical color deviation value, so as to update the first lookup table and form a first updated lookup table. In some embodiments, the first determination module 20 includes a second subunit. Step 0211 can be implemented by the second subunit, that is to say, the second subunit is configured to: and determining a color temperature and color deviation value according to the first white balance gain actual value and the first updating lookup table.

In some embodiments, the electronic device 1000 includes the processor 200, and each of the step 051, the step 052, the step 053, the step 054, the step 055, the step 056 and the step 0211 may be implemented by the processor 200, that is, the processor 200 is configured to acquire a first image of the first camera 300 under a preset light source, a first actual color temperature and a first actual color deviation value; obtaining a first white balance gain calibration value according to the first image, and determining a corresponding first white balance gain lookup value according to the first actual color temperature, the first actual color deviation value and the first lookup table; acquiring the deviation of the first white balance gain calibration value and the first white balance gain searching value and forming a first corresponding relation between the first white balance gain searching value and the deviation; performing interpolation processing on the first corresponding relation to obtain a first interpolation corresponding relation between each first white balance gain searching value and the deviation; moving the first theoretical color temperature and the first theoretical color deviation value according to the first interpolation corresponding relation to reestablish the relation between the first white balance gain theoretical value and the first theoretical color temperature and the first theoretical color deviation value so as to update the first lookup table and form a first updated lookup table; and determining a color temperature and color deviation value according to the first white balance gain actual value and the first updating lookup table.

Specifically, a first image, a first actual color temperature and a first actual color deviation value of the first camera 300 under various actual light sources may be acquired by using a gray card collection method (see fig. 11). For example: the gray card is used for acquiring first images of the first camera 300 under various light sources (the first images are subjected to black level and lens correction processing), R/G and B/G mean values of the gray card are obtained, and meanwhile the illuminometer is used for obtaining a first actual color temperature and a first actual color deviation value. It should be noted that obtaining the first actual color temperature and the first actual color deviation value are performed in a single light source environment as much as possible, so as to avoid uneven light reception of the gray card due to the mixed light source. And obtaining a first white balance gain calibration value according to the first image, and determining a first white balance gain lookup value according to the first actual color temperature, the first actual color deviation value and the first lookup table.

Specifically, the deviation of the first white balance gain calibration value and the first white balance gain lookup value can be obtained by a formula, and the deviation amount of each first white balance gain calibration value (R/G, B/G) from the first white balance gain lookup value (R/G, B/G) is denoted as θ (R/G), θ (B/G). The calculation formula is as follows:where xBin, yBin represents the size of each cell (bin) in the X-direction and Y-direction in the first lookup table. θ (xBin), θ (yBin) is the deviation between the current first white balance gain calibration value and the first white balance gain lookup value. The deviation between the first white balance gain calibration value and the first white balance gain lookup value includes a plurality of deviation amounts θ (xBin) and θ (yBin), please refer to table 1, where table 1 is a light source deviation condition table of the first camera 300 in both row and column directions. In this way, the deviation between the first white balance gain calibration value and the first white balance gain lookup value can be obtained and the first corresponding relation between the first white balance gain lookup value and the deviation can be formed.

TABLE 1

In some embodiments, the interpolation processing on the first corresponding relationship may be performed by using a radial basis function interpolation method, and in order to avoid edge effect caused by the radial basis function interpolation method, 1 group may be added to the interpolated data at each row edge, so that the deviation amount is consistent with the adjacent real beat data (as shown in table 2).

Line of Amount of deviation θ (xBin) Column(s) of Offset theta (yBin)
286 17 376 19
244 17 312 19
134 2 234 18
122 -18 214 -12
91 6 140 -1
75 10 134 -4
45 11 104 -15
1 11 1 -15

TABLE 2

Specifically, the first corresponding relationship is interpolated to obtain a first interpolated corresponding relationship of each first white balance gain lookup value and the deviation. In one example, the energy profile of the preset light source may be exemplified using 6 sets of light source data, in practice the first look-up table comprises 376 x 286 points. And (4) performing interpolation processing on the first corresponding relation, and performing interpolation to calculate the deviation value of 376 × 286 points in each row and each column in the X and Y directions to form the first interpolation corresponding relation.

Referring to fig. 12, (a) in fig. 12 shows the deviation amount of the first camera 300 in the Y direction, and (b) in fig. 12 shows the interpolation result of the radial basis function of the deviation amount of the first camera 300 in the Y direction. Referring to fig. 13, (a) in fig. 13 shows the amount of deviation of the first camera 300 in the X direction, and (b) in fig. 13 shows the interpolation result of the radial basis function of the amount of deviation of the first camera 300 in the X direction. It should be noted that the interpolation may calculate the deviation value of 376 × 286 points in each row and each column in the X and Y directions, which may also be understood as the interpolation calculates the movement amount of 376 × 286 points in each row and each column in the X and Y directions. The moving mode is the whole-row and whole-column movement, and the filling mode is the edge filling.

Referring to table 3 and table 4 together, in one example, table 3 is the result of the last 6 rows of 255 columns in the first theoretical color temperature lookup table, and table 4 is the result of the first updated lookup table after shifting up 2 cells for 255 columns.

Line number Number of rows Numerical value (cct Lut)
279 255 3840
280 255 3720
281 255 3700
282 255 3650
283 255 3620
284 255 3400
285 255 3391
286 255 3211

TABLE 3

Line number Number of rows Numerical value (cct Lut)
279 255 3700
280 255 3650
281 255 3620
282 255 3400
283 255 3391
284 255 3211
285 255 3211
286 255 3211

TABLE 4

Referring to fig. 14 and 15, the first theoretical color temperature and the first theoretical color deviation value may be shifted according to the first interpolation correspondence to reestablish the relationship between the first white balance gain theoretical value and the first theoretical color temperature and the first theoretical color deviation value, so as to update the first lookup table and form a first updated lookup table. The first update look-up table comprises a first theoretical color temperature update look-up table and a first theoretical color deviation value update look-up table. The color temperature and color deviation values can thus be determined from the first white balance gain actual value and the first updated look-up table.

Referring to fig. 16, in some embodiments, determining the second white balance gain scene value of the second camera 400 according to the color temperature and the color deviation value includes:

031: and determining a second white balance gain scene value according to the color temperature, the color deviation value and a second lookup table, wherein the second lookup table comprises a mapping relation between the second white balance gain scene value and the color temperature and color deviation value.

In certain embodiments, the second determination module 30 includes a third subunit. Step 031 may be implemented by a third sub-unit, that is to say, the third sub-unit is configured to: and determining a second white balance gain scene value according to the color temperature, the color deviation value and a second lookup table, wherein the second lookup table comprises a mapping relation between the second white balance gain scene value and the color temperature and color deviation value.

In some embodiments, the electronic device 1000 comprises the processor 200, and step 031 may be implemented by the processor 200, that is, the processor 200 is configured to determine the second white balance gain scene value according to the color temperature, the color deviation value, and a second lookup table, where the second lookup table comprises a mapping of the second white balance gain scene value and the color temperature and color deviation value.

Specifically, a second white balance gain scene value is determined from the color temperature, the color deviation value, and a second lookup table, which includes a mapping relationship of the second white balance gain scene value and the color temperature and color deviation value. In this manner, when the color temperature and the color deviation value are the same, it can be considered that the white balance expressions of the second camera 400 and the first camera 300 are uniform. The mapping relation between the second white balance gain scene value and the color temperature and color deviation value can be quickly and accurately inquired through the second lookup table.

Referring to fig. 17, in some embodiments, a white balance synchronization method includes:

061: generating a third parameter vector according to the second white balance gain theoretical value;

062: generating a fourth parameter vector according to the third parameter vector and the second matrix;

063: and determining a corresponding second theoretical color temperature and a second theoretical color deviation value according to the fourth parameter vector and forming a second lookup table.

In some embodiments, the white balance synchronization apparatus 100 includes a fourth generation module, a fifth generation module, and a sixth generation module. Wherein step 061 may be implemented by the fourth generation module, step 062 may be implemented by the fifth generation module, and step 063 may be implemented by the sixth generation module. That is, the fourth generating module is configured to generate the third parameter vector according to the second white balance gain theoretical value. And the fifth generating module is used for generating a fourth parameter vector according to the third parameter vector and the second matrix. And the sixth generating module is used for determining the corresponding second theoretical color temperature and the second theoretical color deviation value according to the fourth parameter vector and forming a second lookup table.

In some embodiments, the electronic device 1000 comprises a processor 200, and step 061, step 062, and step 063 may all be implemented by the processor 200, that is, the processor 200 is configured to generate a third parameter vector according to the second white balance gain theoretical value; generating a fourth parameter vector according to the third parameter vector and the second matrix; and determining a corresponding second theoretical color temperature and a second theoretical color deviation value according to the fourth parameter vector and forming a second lookup table.

In one example, the image of the second camera 400 includes various color channels, which may include: red channel (R), green channel (G), and blue channel (B). The actual values of the white balance gain in the present application may include R/G and B/G. Thus, a second lookup table with R/G abscissa and B/G ordinate can be made. The second lookup table has a width of 0.0032 per cell (bin) on the horizontal axis and a width of 0.0021 per cell (bin) on the vertical axis. The minimum value of the horizontal axis and the vertical axis is 0.2, the maximum value of the horizontal axis is 1.4, and the maximum value of the vertical axis is 0.8. Thus, a second lookup table of 376 x 286 is constructed. In some embodiments, for example, R/G is 0.2 and B/G is 0.2, G may be defined as 1, and a third parameter vector is generated according to the second white balance gain theoretical value, that is, the third parameter vector is: [ R G B ]. Then, a fourth parameter vector is generated according to the third parameter vector and the second matrix, where the second matrix may be represented by M2, that is, the fourth parameter vector is: [ R G B ] M2 ═ XYZ. And finally, determining a corresponding second theoretical color temperature and a second theoretical color deviation value according to the fourth parameter vector and forming a second lookup table. In some embodiments, the second lookup table comprises a second theoretical color temperature lookup table and a second theoretical color deviation value lookup table.

It is worth mentioning that XYZ vectors obtained by convolving the human eye tristimulus value curve with the light source can correspond to a set of color temperature and color deviation values, and a second theoretical color temperature and a second theoretical color deviation value corresponding to the fourth parameter vector can be determined through the correspondence. In the above example, the minimum value of the horizontal axis and the vertical axis is 0.2, the maximum value of the horizontal axis is 1.4, and the maximum value of the vertical axis is 0.8, so that the probability of being a light source is relatively high in the current coordinate, and the probability of being a light source is relatively low in the other coordinates. It should be noted that the color channels of the second camera 400 include, but are not limited to, an R channel, a G channel, and a B channel, and the above-mentioned examples and specific numerical values are for convenience of describing the implementation of the present application and should not be construed as limiting the scope of the present application.

Referring to fig. 18, in some embodiments, the white balance synchronization method includes:

064: acquiring a first parameter value of the second camera 400 according to the color stimulation value of the second camera 400 and the energy distribution of a preset light source;

065: acquiring a second parameter value of the standard human eye according to the color stimulus value of the standard human eye and the energy distribution of the preset light source;

066: the second matrix is determined based on the second parameter values of the standard human eye and the first parameter values of the second camera 400.

In some embodiments, the white balance synchronization apparatus 100 includes a seventh acquisition module, an eighth acquisition module, and a third processing module. Step 064 may be implemented by a seventh obtaining module, step 065 may be implemented by an eighth obtaining module, and step 066 may be implemented by a third processing module. That is, the seventh obtaining module is configured to obtain the first parameter value of the second camera 400 according to the color stimulation value of the second camera 400 and the energy distribution of the preset light source. The eighth obtaining module is used for obtaining a second parameter value of the standard human eye according to the color stimulation value of the standard human eye and the energy distribution of the preset light source. The third processing module is configured to determine a second matrix according to the second parameter values of the standard human eye and the first parameter values of the second camera 400.

In some embodiments, the electronic device 1000 includes the processor 200, and step 064, step 065, and step 066 may all be implemented by the processor 200, that is, the processor 200 is configured to obtain the first parameter value of the second camera 400 according to the color stimulus value of the second camera 400 and the energy distribution of the preset light source; acquiring a second parameter value of the standard human eye according to the color stimulus value of the standard human eye and the energy distribution of the preset light source; the second matrix is determined based on the second parameter values of the standard human eye and the first parameter values of the second camera 400.

In one example, the second parameter value of the standard human eye may be obtained by using a color stimulus value of the standard human eye and an energy distribution of the preset light source, the color stimulus value of the standard human eye may be obtained by using a three-stimulus curve of the standard human eye, and the energy distribution of the preset light source may use 318 sets of light source data. And convolving the color stimulus value of the standard human eye and 318 groups of light source data to obtain a second parameter value of the standard human eye. The first parameter value of the second camera 400 is obtained by performing convolution according to the color stimulus value 318 set of light source data of the second camera 400 (see fig. 19), and the second camera 400 is, for example, a wide-angle camera. Finally, a second matrix is determined based on the second parameter values of the standard human eye and the first parameter values of the second camera 400, and the second matrix may be a 3 x 3 matrix. The first parameter values of the second camera 400 are mapped to the second parameter values of the standard human eye after being processed by the second matrix.

Referring to fig. 20, in some embodiments, the white balance synchronization method includes:

071: acquiring a second image, a second actual color temperature and a second actual color deviation value of the second camera 400 under a preset light source;

072: obtaining a second white balance gain calibration value according to the second image;

073: determining a corresponding second white balance gain lookup value according to the second actual color temperature, the second actual color deviation value and the second lookup table;

074: acquiring the deviation of the second white balance gain calibration value and the second white balance gain search value and forming a second corresponding relation between the second white balance gain search value and the deviation;

075: performing interpolation processing on the second corresponding relation to obtain a second interpolation corresponding relation between each second white balance gain search value and the deviation;

076: moving the second theoretical color temperature and the second theoretical color deviation value according to the second interpolation corresponding relation to reestablish the relation between the second white balance gain theoretical value and the second theoretical color temperature and the second theoretical color deviation value so as to update the second lookup table and form a second updated lookup table;

determining a second white balance gain scene value from the color temperature, the color deviation value, and a second look-up table, comprising:

0311: and determining a second white balance gain scene value according to the color temperature, the color deviation value and the second updated lookup table.

In some embodiments, the white balance synchronization apparatus 100 includes a ninth obtaining module, a tenth obtaining module, a fourth determining module, an eleventh obtaining module, a fourth processing module, and a second updating module. Step 071 may be implemented by a ninth obtaining module, step 072 may be implemented by a tenth obtaining module, step 073 may be implemented by a fourth determining module, step 074 may be implemented by an eleventh obtaining module, step 075 may be implemented by a fourth processing module, and step 076 may be implemented by a second updating module. That is, the ninth obtaining module is configured to obtain a second image, a second actual color temperature and a second actual color deviation value of the second camera 400 under the preset light source. The tenth obtaining module is configured to obtain a second white balance gain calibration value according to the second image. And the fourth determining module is used for determining a corresponding second white balance gain lookup value according to the second actual color temperature, the second actual color deviation value and the second lookup table. The eleventh acquiring module is configured to acquire a deviation between the second white balance gain calibration value and the second white balance gain lookup value and form a second corresponding relationship between the second white balance gain lookup value and the deviation. The fourth processing module is used for carrying out interpolation processing on the second corresponding relation so as to obtain a second interpolation corresponding relation between each second white balance gain searching value and the deviation. The second updating module is used for moving the theoretical color temperature and the theoretical color deviation value according to the second interpolation corresponding relation so as to reestablish the relation between the second white balance gain theoretical value and the theoretical color temperature and the theoretical color deviation value, so as to update the second lookup table and form a second updated lookup table. In some embodiments, the second determination module 30 includes a fourth subunit. Step 0311 may be implemented by a fourth sub-unit, that is to say, the fourth sub-unit is configured to: and determining a second white balance gain scene value according to the color temperature, the color deviation value and the second updated lookup table.

In some embodiments, the electronic device 1000 includes the processor 200, and step 071, step 072, step 073, step 074, step 075, step 076, and step 0311 can be implemented by the processor 200, that is, the processor 200 is configured to acquire a second image of the second camera 400 under the preset light source, a second actual color temperature, and a second actual color deviation value; obtaining a second white balance gain calibration value according to the second image; determining a corresponding second white balance gain lookup value according to the second actual color temperature, the second actual color deviation value and the second lookup table; acquiring the deviation of the second white balance gain calibration value and the second white balance gain search value and forming a second corresponding relation between the second white balance gain search value and the deviation; performing interpolation processing on the second corresponding relation to obtain a second interpolation corresponding relation between each second white balance gain search value and the deviation; moving the theoretical color temperature and the theoretical color deviation value according to the second interpolation corresponding relation to reestablish the relation between the second white balance gain theoretical value and the theoretical color temperature and the theoretical color deviation value so as to update the second lookup table and form a second updated lookup table; and determining a second white balance gain scene value according to the color temperature, the color deviation value and the second updated lookup table.

Specifically, a second image, a second actual color temperature and a second actual color deviation value of the second camera 400 under various actual light sources may be acquired by using a gray card collection method (see fig. 21). For example: and (3) acquiring second images of the second camera 400 under various light sources by using a gray card (the second images are subjected to black level and lens correction processing), acquiring R/G and B/G mean values of the gray card, and acquiring a second actual color temperature and a second actual color deviation value by using an illuminometer. It should be noted that obtaining the second actual color temperature and the second actual color deviation value are performed in a single light source environment as much as possible, so as to avoid uneven light reception of the gray card due to the mixed light source. And obtaining a second white balance gain calibration value according to the second image, and determining a second white balance gain lookup value according to the second actual color temperature, the second actual color deviation value and the second lookup table.

Specifically, the deviation of the second white balance gain calibration value and the second white balance gain lookup value can be obtained by a formula, and the deviation amount of each second white balance gain calibration value (R/G, B/G) from the second white balance gain lookup value (R/G, B/G) is denoted as θ (R/G), θ (B/G). The calculation formula is as follows:where xBin, yBin represents the size of each cell (bin) in the X-direction and Y-direction in the second lookup table. θ (xBin), θ (yBin) is the deviation between the current second white balance gain calibration value and the second white balance gain lookup value. The deviation of the second white balance gain calibration value and the second white balance gain lookup value comprises a plurality ofPlease refer to table 5 for the deviation amounts θ (xBin) and θ (yBin), where table 5 is a table of the light source deviation of the second camera 400 in both the row and column directions. Thus, the deviation between the second white balance gain calibration value and the second white balance gain search value can be obtained, and a second corresponding relation between the second white balance gain search value and the deviation can be formed.

Line of Amount of deviation (xBin) Column(s) of Offset theta (yBin)
244 -10 255 40
147 4 199 26
140 -4 188 7
97 13 140 6
81 1 134 6
39 1 98 1

TABLE 5

In some embodiments, the interpolation processing on the second correspondence may be performed by using a radial basis function interpolation method, and in order to avoid an edge effect generated by the radial basis function interpolation method, 1 group may be added to the interpolated data at each row edge, so that the deviation amount is consistent with the adjacent real beat data (as shown in table 6).

Line of Amount of deviation (xBin) Column(s) of Offset theta (yBin)
286 -10 376 40
244 -10 255 40
147 4 199 26
140 -4 188 7
97 13 140 6
81 1 134 6
39 1 98 1
1 1 1 1

TABLE 6

Specifically, the second corresponding relationship is interpolated to obtain a second interpolation corresponding relationship between each second white balance gain lookup value and the deviation. In one example, the energy profile of the preset light source may be exemplified using 6 sets of light source data, in practice the second lookup table comprises 376 x 286 points. And performing interpolation processing on the second corresponding relation, and performing interpolation to calculate the deviation value of 376 × 286 points in each row and each column in the X and Y directions to form a second interpolation corresponding relation.

Referring to fig. 22, (a) in fig. 22 shows the amount of deviation of the second camera 300 in the Y direction, and (b) in fig. 22 shows the interpolation result of the radial basis function of the amount of deviation of the second camera 300 in the Y direction. Referring to fig. 23, (a) in fig. 23 shows the amount of deviation of the second camera 300 in the X direction, and (b) in fig. 23 shows the interpolation result of the radial basis function of the amount of deviation of the second camera 300 in the X direction. It should be noted that the interpolation may calculate the deviation value of 376 × 286 points in each row and each column in the X and Y directions, which may also be understood as the interpolation calculates the movement amount of 376 × 286 points in each row and each column in the X and Y directions. The moving mode is the whole-row and whole-column movement, and the filling mode is the edge filling.

As such, a second white balance gain scene value may be determined from the color temperature, the color deviation value, and the second updated look-up table.

Referring to fig. 24, in some embodiments, the white balance synchronization method further includes:

081: processing the first white balance gain actual value by using the prediction model to obtain a second white balance gain search value of the second camera 400;

082: a second white balance gain value for the second camera 400 is determined based on the second white balance gain lookup value and the second white balance gain scene value.

In some embodiments, the white balance synchronization apparatus 100 includes a twelfth obtaining module and a fifth determining module. Wherein step 081 may be implemented by the twelfth acquisition module and step 082 may be implemented by the fifth determination module. That is, the twelfth obtaining module is configured to process the first white balance gain actual value by using the prediction model to obtain the second white balance gain search value of the second camera 400. The fifth determining module is configured to determine a second white balance gain value of the second camera 400 according to the second white balance gain lookup value and the second white balance gain scene value.

In some embodiments, the electronic device 1000 comprises a processor 200, and the steps 081 and 082 can be implemented by the processor 200, that is, the processor 200 is configured to process the first white balance gain actual value using a prediction model to obtain a second white balance gain search value for the second camera 400; a second white balance gain value for the second camera 400 is determined based on the second white balance gain lookup value and the second white balance gain scene value.

In this way, the second white balance gain value of the second camera 400 is determined according to the second white balance gain lookup value and the second white balance gain scene value so that the second white balance gain value is more accurate. Specifically, the second white balance gain scene value may be multiplied by a preset coefficient a, the second white balance gain search value may be multiplied by (1-a), and the results of the two are added to obtain the second white balance gain value. Wherein a is, for example, 0.5.

Referring to fig. 25, in some embodiments, a white balance synchronization method includes:

083: acquiring a first white balance gain training set of the first camera 300 according to the color stimulus value of the first camera 300, the energy distribution of a preset light source and the reflectivity of various objects;

084: acquiring a second white balance gain training set of the second camera 400 according to the color stimulation value of the second camera 400, the energy distribution of a preset light source and the reflectivity of various objects;

085: and training the mapping model according to the first white balance gain training set and the second white balance gain training set to adjust the weight of the mapping model and obtain a prediction model.

In some embodiments, the white balance synchronization apparatus 100 includes a thirteenth acquisition module, a fourteenth acquisition module, and a fifteenth acquisition module. Step 083 may be implemented by a thirteenth acquiring module, step 084 may be implemented by a fourteenth acquiring module, and step 085 may be implemented by a fifteenth acquiring module. That is, the thirteenth acquisition module is configured to acquire the first white balance gain training set of the first camera 300 according to the color stimulus value of the first camera 300, the energy distribution of the preset light source, and the reflectivities of various objects. The fourteenth acquiring module is configured to acquire the second white balance gain training set of the second camera 400 according to the color stimulation value of the second camera 400, the energy distribution of the preset light source, and the reflectivities of various objects. The fifteenth obtaining module is configured to train the mapping model according to the first white balance gain training set and the second white balance gain training set to adjust the weight of the mapping model and obtain the prediction model.

In some embodiments, the electronic device 1000 includes the processor 200, and each of the steps 083, 084 and 085 may be implemented by the processor 200, that is, the processor 200 is configured to obtain a first white balance gain training set of the first camera 300 according to the color stimulus value of the first camera 300, the energy distribution of the preset light source, and the reflectivity of various objects; acquiring a second white balance gain training set of the second camera 400 according to the color stimulation value of the second camera 400, the energy distribution of a preset light source and the reflectivity of various objects; and training the mapping model according to the first white balance gain training set and the second white balance gain training set to adjust the weight of the mapping model and obtain a prediction model.

Specifically, a first white balance gain training set of the first camera 300 is obtained according to the color stimulus value of the first camera 300, the energy distribution of the preset light source, and the reflectivities of various objects, and a second white balance gain training set of the second camera 400 is obtained according to the color stimulus value of the second camera 400, the energy distribution of the preset light source, and the reflectivities of various objects. The color stimulus value can be obtained by a color stimulus value curve including three color channels of an R channel, a G channel, and a B channel. The energy distribution of the preset light source can be the response of the ambient light source in a visible light wave band (380 nm-780 nm), and 318 kinds of light source data can be obtained from the public data set to serve as the energy distribution data of the preset light source. Among the reflectances of various objects, the objects include, for example: gold, silver, copper, aluminum, nickel, and platinum.

In some embodiments, the color stimulus values of the first camera 300 include color stimulus values of a plurality of color channels, the energy distribution of the preset light source includes the energy distribution of the preset light source, the reflectances of the various objects include the reflectance of a preset gray block, the first white balance gain training set includes a plurality of first white balance gain training values; acquiring a first white balance gain training set of the first camera 300 according to the color stimulus value of the first camera 300, the energy distribution of the preset light source and the reflectivity of various objects, including:

calculating the pixel value of a corresponding color channel according to the color stimulation value of one color channel, the energy distribution of a preset light source and the reflectivity of a preset gray block;

and acquiring pixel values of all color channels as first white balance gain training values.

Thus, the pixel value of the corresponding color channel is calculated according to the color stimulus value of one color channel, the energy distribution of the preset light source and the reflectivity of the preset gray block, and then the pixel value of each color channel can be obtained to be used as the first white balance gain training value.

In some embodiments, calculating the pixel value of the corresponding color channel according to the color stimulation value of one color channel, the energy distribution of the preset light source, and the reflectivity of the preset gray block comprises:

calculating the pixel value of a color channel using a predetermined formula

ρk=∫E(λ)S(λ)Rk(λ)dλk∈R,G,B

k is each color channel including R, G, and B channels, ρkIs the pixel value of the corresponding color channel, λ is the wavelength, E (λ) is the energy distribution of the preset light source, S (λ) is the reflectivity of the preset gray block, Rk(λ) is the color stimulus value of the corresponding color channel.

In one example, k is each color channel of the first camera 300, and the color channels may include: red channel (R1), green channel (G1), and blue channel (B1). The preset gray block may be the reflectivity of the last 6 gray blocks of the 24 color chip. In this way, the pixel value of each color channel can be obtained by presetting the energy distribution of the light source, the reflectivity of the gray block and the color stimulus value of each color channel. It is worth mentioning that the color channels of the first camera 300 include, but are not limited to, R1 channel, G1 channel, and B1 channel, which should not be construed as limiting the present application.

In some embodiments, the obtaining the pixel value of each color channel as the first white balance gain training value includes:

and acquiring the ratio of the pixel value of each other channel to the pixel value of the preset channel as a first white balance gain training value.

In one example, the default channel may be the G1 channel, and the other channels include the R1 channel and the B1 channel, such that the first white balance gain training values are (G1/R1, G1/B1). It is worth mentioning that, in the above example, the G channel is used as the preset channel, and compared to the R channel and the B channel, the light sensitivity of the G channel is the highest, and the accuracy of the calculated first white balance gain training value is higher. In some embodiments, the first white balance gain training value may also be calculated for the preset channel by using other color channels, which is not limited herein.

In some embodiments, the color stimulus values of the second camera 400 include color stimulus values of a plurality of color channels, the energy distribution of the preset light source includes the energy distribution of the preset light source, the reflectivities of the various objects include the reflectivity of a preset gray block, and the second white balance gain training set includes a plurality of second white balance gain training values; acquiring a second white balance gain training set of the second camera 400 according to the color stimulus value of the second camera 400, the energy distribution of the preset light source and the reflectivity of various objects, including:

calculating the pixel value of a corresponding color channel according to the color stimulation value of one color channel, the energy distribution of a preset light source and the reflectivity of a preset gray block;

and acquiring the pixel value of each color channel as a second white balance gain training value.

Thus, the pixel value of the corresponding color channel is calculated according to the color stimulus value of one color channel, the energy distribution of the preset light source and the reflectivity of the preset gray block, and then the pixel value of each color channel can be obtained to be used as a second white balance gain training value.

In some embodiments, calculating the pixel value of the corresponding color channel according to the color stimulation value of one color channel, the energy distribution of the preset light source, and the reflectivity of the preset gray block comprises:

calculating the pixel value of a color channel using a predetermined formula

ρk=∫E(λ)S(λ)Rk(λ)dλk∈R,G,B

k is each color channel including R, G, and B channels, ρkIs the pixel value of the corresponding color channel, λ is the wavelength, E (λ) is the energy distribution of the preset light source, S (λ) is the reflectivity of the preset gray block, Rk(λ) is the color stimulus value of the corresponding color channel.

In one example, k is each color channel of the second camera 400, and the color channels may include: red channel (R2), green channel (G2), and blue channel (B2). The preset gray block may be the reflectivity of the last 6 gray blocks of the 24 color chip. In this way, the pixel value of each color channel can be obtained by presetting the energy distribution of the light source, the reflectivity of the gray block and the color stimulus value of each color channel. It is worth mentioning that the color channels of the second camera 400 include, but are not limited to, R2 channel, G2 channel, and B2 channel, and are not to be construed as limiting the present application.

In some embodiments, the 318 illuminant data as the energy distribution data of the preset illuminant and the reflectivity of the last 6 gray blocks of the 24 color chart are combined with the color stimulus values of the color channels of the first camera 300 and the second camera 400 to form 1908 sets of pixel value data (i.e., the first white balance gain training set and the second white balance gain training set), which reflect the white balance information of the first camera 300 and the second camera 400 under various illuminants.

In some embodiments, the obtaining the pixel value of each color channel as the second white balance gain training value includes:

and acquiring the ratio of the pixel value of each other channel to the pixel value of the preset channel as a second white balance gain training value.

In one example, the default channel may be the G2 channel, and the other channels include the R2 channel and the B2 channel, such that the second white balance gain training values are (G2/R2, G2/B2). It should be noted that, in the above example, the G channel is used as the preset channel, and compared to the R channel and the B channel, the light sensitivity of the G channel is the highest, and the accuracy of the calculated second white balance gain training value is higher. In some embodiments, other color channels may also be used to calculate the second white balance gain training value for the preset channel, which is not limited herein.

In some embodiments, the first white balance gain training set includes a plurality of first white balance gain training values, the mapping model is a radial basis function network, the radial basis function network includes a plurality of training nodes, and training the mapping model according to the first white balance gain training set and the second white balance gain training set to adjust weights of the mapping model and obtain the prediction model includes:

determining a plurality of center points of a first white balance gain training value;

and respectively determining a plurality of training nodes according to the plurality of central points to obtain a radial basis function network.

In one example, the first white balance gain training set includes a plurality of first white balance gain training values, and the plurality of center points of the first white balance gain training values may be obtained by clustering the plurality of first white balance gain training values using a clustering algorithm (e.g., a kmeans algorithm). For example: the number of the central points may be 8, and 8 training nodes may be respectively determined according to the 8 central points to obtain the radial basis function network.

In some embodiments, training the mapping model according to the first white balance gain training set and the second white balance gain training set to adjust the weights of the mapping model and obtain the prediction model further comprises:

taking the first white balance gain training set as the input of the radial basis function network, taking the second white balance gain training set as the output of the radial basis function network, and training the radial basis function network by utilizing the variance of the plurality of radial basis functions to obtain the weights of the plurality of radial basis functions and the plurality of trained radial basis function networks;

testing the plurality of trained radial basis function networks using the white balance gain test set to determine an error of each trained radial basis function network;

and taking the trained radial basis function network with the minimum error as a prediction model.

In one example, the first and second white balance gain training sets may include 1908 sets of data as training data. And training the radial basis function network by using the variance of the plurality of radial basis functions to obtain the weights of the plurality of radial basis functions and the plurality of trained radial basis function networks. The white balance gain test set comprises a first white balance gain actual value test set and a second white balance gain test set, the first white balance gain actual value test set outputs a first white balance gain actual value test set output result after passing through the trained radial basis function network, the first white balance gain actual value test set output result is a second white balance gain calculation set, the second white balance gain calculation set is compared with the second white balance gain training set, the error between the second white balance gain calculation set and the second white balance gain training set is determined, and the trained radial basis function network with the minimum error is used as a prediction model.

The variance of the radial basis function may be manually specified, and after multiple times of debugging, a suitable variance of the radial basis function is selected, for example: and selecting [ 1.91.9 ] as the variance of the radial basis function after multiple times of debugging, wherein the trained radial basis function network at the moment is the trained radial basis function network with the minimum error, and thus, the trained radial basis function network is used as a prediction model. The trained prediction model can reflect the white balance mapping relationship between the first camera 300 and the second camera 400, so that the prediction model can obtain the white balance gain actual value of the second camera 400 according to the white balance gain actual value of the first camera 300, and further realize the color consistency of the first camera 300 and the second camera 400.

Thus, the first white balance gain training set and the second white balance gain training set are obtained according to the same energy distribution of various light sources and the same reflectivity of various objects, and therefore, the first white balance gain training set and the second white balance gain training set correspond to each other, and the mapping model is trained through the corresponding training sets, so that the trained prediction model can reflect the white balance mapping relationship between the first camera 300 and the second camera 400, the prediction model can obtain the white balance gain actual value of the second camera 400 according to the white balance gain actual value of the first camera 300, and further the color consistency of the first camera 300 and the second camera 400 is realized.

Referring to fig. 26, in some embodiments, the white balance synchronization method includes:

091: collecting a first white balance gain actual training set of the first camera 300 under a lamp box;

092: collecting a second white balance gain actual training set of the second camera 400 under the light box;

training the mapping model according to the first white balance gain training set and the second white balance gain training set to adjust the weight of the mapping model and obtain a prediction model, comprising:

0851: and training the mapping model according to the first white balance gain training set, the second white balance gain training set, the first white balance gain actual training set and the second white balance gain actual training set to adjust the weight of the mapping model and obtain a prediction model.

In some embodiments, the white balance synchronization apparatus 100 includes a first acquisition module, a second acquisition module, and a sixteenth acquisition module. Wherein, step 091 may be implemented by the first acquisition module, step 092 may be implemented by the second acquisition module, and step 0851 may be implemented by the sixteenth acquisition module. That is, the first acquisition module is configured to acquire a first white balance gain actual training set of the first camera 300 under the light box. The second acquisition module is used for acquiring a second white balance gain actual training set of the second camera 400 under the light box. The sixteenth obtaining module is configured to train the mapping model according to the first white balance gain training set, the second white balance gain training set, the first white balance gain actual training set, and the second white balance gain actual training set to adjust the weight of the mapping model and obtain the prediction model.

In some embodiments, the electronic device 1000 includes the processor 200, and step 091, step 092, and step 0851 can be implemented by the processor 200, that is, the processor 200 is configured to acquire the first white balance gain actual training set of the first camera 300 under the light box; collecting a second white balance gain actual training set of the second camera 400 under the light box; and training the mapping model according to the first white balance gain training set, the second white balance gain training set, the first white balance gain actual training set and the second white balance gain actual training set to adjust the weight of the mapping model and obtain a prediction model.

In one example, a first white balance gain actual training set of the first camera 300 under several standard light sources in the light box may be collected; and collecting a second white balance gain actual training set of the second camera 400 under several standard light sources in the light box. Several standard light sources under the light box include: d75, D65, CWF, TL84, A and the like. The data obtained under several standard light sources in the light box can be weighted by 10 times to obtain a first white balance gain training set and a second white balance gain training set. And training the mapping model according to the first white balance gain training set, the second white balance gain training set, the first white balance gain actual training set and the second white balance gain actual training set to adjust the weight of the mapping model and obtain a prediction model. Therefore, the accuracy loss caused by errors of the first white balance gain training set and the second white balance gain training set can be avoided, and the prediction model can be more accurate.

It should be noted that the white balance synchronization method according to the above embodiment may be implemented by the white balance synchronization apparatus 100, or may be implemented by the electronic device 1000 according to the embodiment of the present application, and is not limited herein.

The computer-readable storage medium of the embodiments of the present application stores thereon a computer program, which, when executed by a processor, implements the steps of the white balance synchronization method of any of the above-described embodiments.

In the computer-readable storage medium of the above embodiment, when the color temperature and the color deviation value are the same, the white balance performances of the first camera 300 and the second camera 400 are consistent, since the second white balance gain scene value of the second camera 400 is determined by the color temperature and the color deviation value, which are determined according to the first white balance gain actual value of the first camera 300, the color consistency of the first camera 300 and the second camera 400 can be achieved by performing the white balance processing on the first camera 300 by the first white balance gain actual value and performing the white balance processing on the second camera 400 by the second white balance gain scene value.

It will be appreciated that the computer program comprises computer program code. The computer program code may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), software distribution medium, and the like.

In the description herein, reference to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example" or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.

The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processing module-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM).

Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.

It should be understood that portions of the embodiments of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.

It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.

In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.

The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.

Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations of the above embodiments may be made by those of ordinary skill in the art within the scope of the present application.

40页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种图像绿通道平衡的方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类