White balance adjustment method, device, electronic device and storage medium

By calculating the similarity and weight between multiple frame images, more accurate timing white balance value calculation and image adjustment are achieved, solving the problem of poor white balance effect in the existing technology, and improving image quality and user experience.

CN114979608BActive Publication Date: 2024-09-27VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210496098.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-06
Publication Date
2024-09-27
Estimated Expiration
2042-05-06

AI Technical Summary

Technical Problem

The existing sequential white balance method has poor white balance effect in image processing, resulting in inconsistent image quality and affecting the user's shooting experience.

Method used

By obtaining the information and white balance values ​​of multi-frame images, the degree of similarity between the images is calculated, the fusion weight is determined, and the sequential white balance value is calculated based on the weight and white balance value to adjust the white balance of the image.

Benefits of technology

It improves the accuracy and consistency of white balance effects, improving the user’s shooting experience and image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979608B
    Figure CN114979608B
Patent Text Reader

Abstract

The present application discloses a white balance adjustment method, device, electronic device and storage medium, belonging to the field of image technology. The method includes: obtaining first information and a first single-frame white balance value of a first image and second information and a second single-frame white balance value of N second images; obtaining a fusion weight of the second image for the first image according to the first information and the second information; wherein the acquisition time of the second image is earlier than the acquisition time of the first image; obtaining a time-series white balance value of the first image according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value; performing white balance adjustment on the first image according to the time-series white balance value to obtain the adjusted first image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image technology, and specifically relates to a white balance adjustment method, device, electronic device and storage medium. Background Art

[0002] In the image quality processing of the device to be adjusted, in order to accurately restore the scenes and characters on the screen and achieve realistic colors and high image quality, the key basis is to select a suitable standard white and ensure that the color temperature and white balance of the white balance adjustment device are controlled within a reasonable range. The color temperature and white balance of the device to be adjusted are affected by its backlight system, manufacturing process, materials, etc. Even products from the same batch have the problem of discreteness of color temperature and white balance. If the white balance is not adjusted, the image quality of the device to be adjusted will be seriously affected, and the image quality of the product will also be uneven. The existing temporal white balance method only performs simple calculations through time distance and image similarity, and the white balance effect achieved is poor. Summary of the invention

[0003] The purpose of the present application is to provide a white balance adjustment method, device, electronic device and storage medium, which can solve the problem of poor white balance effect.

[0004] In a first aspect, the present application provides a white balance adjustment method, the method comprising: obtaining first information and a first single-frame white balance value of a first image and second information and second single-frame white balance values ​​of N second images; obtaining a fusion weight of the second image for the first image based on the first information and the second information; wherein the acquisition time of the second image is earlier than the acquisition time of the first image; obtaining a temporal white balance value of the first image based on the fusion weight, the first single-frame white balance value and the second single-frame white balance value; performing white balance adjustment on the first image based on the temporal white balance value to obtain an adjusted first image.

[0005] In a second aspect, the present application provides a white balance adjustment device, which includes: a first acquisition module, used to acquire first information and a first single-frame white balance value of a first image and second information and second single-frame white balance values ​​of N second images; a fusion weight module, used to obtain a fusion weight of the second image for the first image based on the first information and the second information; wherein the acquisition time of the second image is earlier than the acquisition time of the first image; the first acquisition module, based on the fusion weight, the first single-frame white balance value and the second single-frame white balance value, obtains a temporal white balance value of the first image; and a result output module, used to perform white balance adjustment on the first image according to the temporal white balance value to obtain an adjusted first image.

[0006] In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0007] In a fourth aspect, the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0008] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0009] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0010] In the present application, the degree of similarity between the second image and the first image can be obtained based on the first information of the first image and the second information of N second images. The higher the similarity, the better the effect of white balancing the first image by fusing the corresponding second single-frame white balance value. That is, the degree of similarity between the second image and the first image reflects the value of white balancing the first image by the corresponding second single-frame white balance value. In this way, the fusion weight of the second image relative to the first image is obtained based on the first information of the first image and the second information of the second image. The temporal white balance value of the first image determined based on the fusion weight of the second image relative to the first image, the second single-frame white balance value and the first single-frame white balance value will be a more accurate white balance value. Furthermore, adjusting the white balance of the first image based on the temporal white balance value will also obtain a more accurate white balance effect, thereby improving the user's shooting experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 A flow chart of a white balance adjustment method according to an embodiment of the present disclosure is shown.

[0012] Figure 2 A block diagram of a white balance adjustment device according to an embodiment of the present disclosure is shown.

[0013] Figure 3 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0014] Figure 4 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0016] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0017] The white balance adjustment method, device, electronic device and storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0018] Figure 1 1 is a flow chart of a white balance adjustment method according to an embodiment of the present disclosure. The method can be applied to a server or a terminal device, and is not limited here. Figure 1 As shown, the method includes steps S11 to S14.

[0019] Step S11, obtaining first information and a first single-frame white balance value of a first image and second information and second single-frame white balance values ​​of N second images.

[0020] In an example of this embodiment, the first image may be an image of the current frame. After acquiring the image of the current frame, the shooting terminal may directly read the single-frame white balance value of the current frame without weight calculation based on an algorithm of the single-frame white balance value.

[0021] In an example of the present embodiment, the first information includes scene information of the first image and the information amount of the first image, the scene information of the first image includes image feature information and acquisition feature information, the scene information also includes acquisition time information, wherein the feature information of the image includes color information of the image on the R channel, color information of the image on the B channel, color information of the edge map of the image on the R channel, and color information of the edge map of the image on the B channel.

[0022] For example, after acquiring the first image I, the terminal device can first calculate the edge map Ie of the image I. Then, the two-bit color histogram His0 of the first image I in the rgain / bgain space and the two-bit color histogram His1 of the edge map Ie in the rgain / bgain space can be calculated. By accumulating the two-bit color histogram His0 along the rgain axis, a one-dimensional cumulative histogram can be obtained, that is, the color information rg-c of the image on the R channel. Similarly, by accumulating His0 along the bgain axis, the color information bg-c of the image on the B channel can be obtained. By accumulating the two-bit color histogram His1 along the rgain axis, the color information rg-e of the image edge map on the R channel can be obtained. By accumulating His1 along the bgain axis, the color information bg-e of the image edge map on the B channel can be obtained.

[0023] In one example of this example, the acquisition time information may be automatically acquired when the first image is acquired.

[0024] In an example of this embodiment, the acquisition feature information of the first image includes at least one of acquisition viewing angle information and acquisition brightness information.

[0025] In an example of this embodiment, the acquisition viewing angle information of the first image can be obtained by a gyroscope sensor. For example, a gyroscope sensor can be provided in the terminal device, and the gyroscope sensor can acquire the direction vector g of the lens center axis direction as the acquisition viewing angle information of the first image when acquiring the first image.

[0026] In an example of this embodiment, the collected brightness information may be an automatic exposure parameter exp-idx of a camera, which may be automatically acquired when acquiring the first image.

[0027] It should be noted that although the above example introduces a specific example of obtaining the scene information of the first image, those skilled in the art will understand that the present disclosure is not limited thereto, and those skilled in the art can flexibly set the specific method of obtaining the scene information of the first image according to actual needs.

[0028] In an example of this embodiment, after the terminal device turns on the camera, a timing buffer queue is created, and the timing buffer queue Q records frames of different scenes acquired after the camera is turned on, that is, the second image. The number of second images in the timing buffer queue Q can be N, and the relevant information of the N second images is stored in the storage space, and the relevant information of the second image includes scene information, single-frame white balance value, timing white balance value and weight of the second image, information volume of the second image, etc.

[0029] Step S12, obtaining a fusion weight of the second image with respect to the first image according to the first information and the second information; wherein the acquisition time of the second image is earlier than the acquisition time of the first image.

[0030] Step S13, obtaining a temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value.

[0031] In an example of this embodiment, based on the fusion weight of each second image in N second images with respect to the first image, the second single-frame white balance value of each second image, and the first single-frame white balance value, a weighted average value of the single-frame white balance is obtained as the temporal white balance value of the first image.

[0032] For example, for the first image, that is, the current frame cur_frame temporal white balance value wb_t, it can be determined according to the single frame white balance value wb_raw of the current frame, each frame in the temporal buffer queue, that is, the fusion weight of the N second images and the single frame white balance value of each frame, such as the formula:

[0033]

[0034] Among them, w i is the fusion weight of the i-th frame image in the timing buffer queue, wb_raw i is the single frame white balance value of the i-th frame in the timing buffer queue. The first image has the highest weight, and the corresponding weight coefficient is 1.

[0035] Step S14, performing white balance adjustment on the first image according to the temporal white balance value to obtain an adjusted first image.

[0036] In this embodiment, the temporal white balance value of the current image is obtained according to the first information of the first image, the second information of the second image, and the fusion weight of the second image and the current image, and the image is adjusted according to the temporal white balance value of the current image. In this way, a more accurate temporal white balance value can be obtained during shooting, a more accurate white balance effect is achieved, and the user's shooting experience is improved.

[0037] In an example of this embodiment, before obtaining the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value, and the second single-frame white balance value, the method includes: obtaining the information amount of the first image in the first information, and determining the prediction confidence of the first image according to the information amount of the first image. When the prediction confidence of the first image is greater than or equal to the first threshold, the step of obtaining the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value, and the second single-frame white balance value is performed.

[0038] In an example of this embodiment, the information amount of the first image can be calculated using an information entropy formula, for example, the two-bit color histogram His0 of the first image I in the rgain / bgain space and the two-bit color histogram His1 of the edge image Ie in the rgain / bgain space. According to the information entropy formula, the information entropy of the two-bit color histogram His0 of the first image I in the rgain / bgain space is calculated to be H0, and the information entropy of the two-bit color histogram His1 of the edge image Ie in the rgain / bgain space is calculated to be H1. The information amount h of the first image can be expressed as shown in the formula:

[0039] h=w0·H0+w1·H1

[0040] Among them, w0 and w1 are weight parameters of information entropy H0 and H1 respectively.

[0041] In an example of this embodiment, according to the information amount h of the first image, the confidence Conf of the prediction result of the first image can be determined, as shown in the formula:

[0042] Conf=a*h 2 +b*h+c,ε1<=h<=ε2

[0043] Among them, a, b, c, ε1, ε2 are hyperparameters, which can be adapted according to the scene in the first image. After calculating the prediction confidence Conf of the first image, Conf can be compared with a first threshold value, which is a threshold value for judging whether the amount of information of the image is normal. When the first prediction confidence Conf is greater than the first threshold value, it can be determined that the amount of information of the first image is normal, and the first image can be further calculated to obtain the temporal white balance value of the first image.

[0044] In this embodiment, before calculating the temporal white balance value of the first image, the information amount of the first image can be judged first. When the information amount of the first image is sufficient, the temporal white balance value of the first image can be obtained. In this way, the problem of obtaining inaccurate temporal white balance values ​​when the image information amount is insufficient can be avoided, thereby improving the user experience.

[0045] In an example of this embodiment, after determining the prediction confidence of the first image according to the information amount of the first image, the method further includes: when the prediction confidence of the first image is less than the first threshold, comparing the image feature information of the first image in the first information with the image feature information of the second image in the second information, and comparing the autofocus information of the first image in the first information with the autofocus information of the second image in the second information, and determining whether the first image is included in the second image according to the comparison result, wherein the second image is the second image whose acquisition time is closest to the first image among the N second images. When the first image is included in the second image, the temporal white balance value of the second image is used as the temporal white balance value of the first image. When the first image is not included in the second image, the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image is performed.

[0046] In an example of this embodiment, the second image is the Nth second image in the timing buffer queue, that is, the image of the last frame in the timing buffer queue, and the image feature information of the second image is the image feature information corresponding to the Nth second image in the timing buffer queue.

[0047] In an example of this embodiment, when the prediction confidence Conf of the first image is less than the first threshold, the amount of information of the image is insufficient, and it is necessary to determine whether the first image is included in the Nth second image.

[0048] In an example of this embodiment, the result P of determining that the first image is included in the Nth second image needs to meet four conditions, and condition 1 is that the difference between the autofocus information of the Nth second image and the autofocus information of the first image is greater than a preset parameter. Condition 2 is that the image similarity distance between the first image and the Nth second image is less than a preset parameter. Condition 3 is that the intersection of the first image and the Nth second image on the rgain axis is greater than a preset parameter. Condition 4 is that the intersection of the first image and the Nth second image on the bgain axis is greater than a preset parameter.

[0049] In an example of this embodiment, the auto focus information of the first image is AF0, the auto focus information of the Nth second image is AF1, ε3 is a preset parameter, and condition 1 is:

[0050] Cond1=AF1-AF0>ε3

[0051] The similarity distance d_I between the first image and the Nth second image can be determined based on the color information of the first image and the Nth second image on the R channel, the color information of the image on the B channel, the color information of the image edge map on the R channel, and the color information of the image edge map on the B channel. Specifically, the rg_c, bg_c, rg_e, and bg_e of the first image and the second image can be measured by the Bhattacharyya distance, and finally integrated in a weighted manner to obtain the image similarity distance d_I. The measurement function of the Bhattacharyya distance is denoted as B(x,y),

[0052]

[0053]

[0054] d_I=w1*c_sim+w2*e_sim

[0055] in, It can be determined based on the color information of the Nth second image on the R channel, the color information of the image on the B channel, the color information of the edge map of the image on the R channel, and the color information of the edge map of the image on the B channel. It can be determined based on the color information of the first image on the R channel, the color information of the image on the B channel, the color information of the edge map of the image on the R channel, and the color information of the edge map of the image on the B channel. w1 and w2 are weight parameters.

[0056] Condition 2 is that the image similarity distance between the first image and the Nth second image is less than the preset parameter ε4, that is, condition 2 is:

[0057] Cond2=d_I<ε4

[0058] The intersection inter_r of the first image and the Nth second image on the rgain axis and the intersection inter_b of the first image and the second image on the bgain axis are:

[0059] inter_r=(∑r0*mask_r) / ∑r0

[0060] inter_b=(∑b0*mask_b) / ∑b0

[0061] Among them, r0 is the color information of the first image on the R channel, b0 is the color information of the first image on the R channel. mask_r is the result of removing noise from the color information of the Nth second image on the R channel, and mask_b is the result of removing noise from the color information of the Nth second image on the B channel.

[0062] Conditions 3 and 4 are:

[0063] Cond3=inter_r>ε5

[0064] Cond4=inter_b>ε6

[0065] Among them, ε5 and ε6 are preset parameters. It should be noted that the preset parameters in this example can be flexibly set by those skilled in the art according to actual conditions.

[0066] When the comparison result between the first image and the Nth second image satisfies conditions 1, 2, 3 and 4, it is determined that the first image is included in the Nth second image, that is,

[0067] P=Cond1&&Cond2&&Cond3&&Cond4

[0068] In an example of this embodiment, when the first image is included in the second image, that is, the first image is a part of the second image, and the first image is obtained by enlarging the second image, the temporal white balance value of the second image can be directly adjusted as the temporal white balance value of the first image. When the first image is not included in the second image, the temporal white balance value of the first image is obtained by the aforementioned method according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value.

[0069] In this example, by comparing the image feature information and autofocus information of the first image and the second image, it is determined whether the first image is included in the second image. When the first image is included in the second image, the temporal white balance result of the second image can be directly used for adjustment to provide a better experience.

[0070] In an example of this embodiment, a fusion weight of the second image for the first image is obtained based on the first information and the second information, including: determining the prediction confidence of the second image based on the amount of information of the second image in the second information; and obtaining the fusion weight of the second image for the first image based on the first information, the second information and the prediction confidence of the second image.

[0071] In an example of the present embodiment, a fusion weight of the second image for the first image is obtained based on the first information and the second information, including: determining the prediction confidence of the second image based on the amount of information of the second image in the second information, and determining the similarity between the second image and the first image based on the scene information of the second image in the second information and the scene information of the first image in the first information; wherein the scene information includes image feature information and acquisition feature information, the acquisition feature information includes at least one of acquisition viewing angle information and acquisition brightness information, and the fusion weight of the second image for the first image is obtained based on the prediction confidence of the second image and the similarity between the second image and the first image.

[0072] For example, the fusion weight w_i of each second image frame_i of the timing buffer queue Q is obtained according to the confidence of the second image, such as the formula:

[0073]

[0074] Represents the similarity between the second image and the first image. α1, α2, α3, and α4 are parameters based on field settings. d_i is the image similarity distance between the second image and the first image. d_g is the cosine distance between the direction vectors of the lens center axis of the first image and the second image. The direction vector of the lens center axis can be obtained by the gyroscope sensor. d_l is the distance between the automatic exposure parameter exp_idx of the first image and the second image, which can be obtained by subtracting the exp_idx of the first image from the second image. d_t is the time distance between the first image and the second image, which can be obtained by subtracting the time of obtaining the first image from the time of obtaining the second image.

[0075] In an example of this embodiment, after obtaining the first information and the first single-frame white balance value of the first image and the second information and the second single-frame white balance value of N second images, the method further includes: determining whether the first image and the second image are images of the same scene according to the first information of the first image and the second information of the second image, wherein the second image is the second image whose acquisition time is closest to the first image among the N second images. In the case that the first image and the second image are not in the same scene, the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image is performed. In the case that the first image and the second image are in the same scene, the temporal white balance value of the first image is obtained according to the single-frame white balance value of the first image, the single-frame white balance value of the second image, the temporal white balance value of the second image, and the sum of the fusion weights of each frame of the second image to the first image.

[0076] In an example of this embodiment, whether the first image and the Nth second image are of the same scene can be determined based on the scene information of the first image and the scene information of the second image in the storage space. Specifically, the image similarity distance d_I between the first image and the second image, the cosine distance d_g of the direction vectors of the lens center axis direction of the first image and the second image, the distance d_l of the automatic exposure parameters of the first image and the second image, and the time distance d_t between the first image and the second image can be determined based on the scene information of the first image and the second image. When d_I, d_g, d_l, and d_t all meet the conditions of the logical operation, it is determined that the first image and the second image are of the same scene.

[0077] In an example of this embodiment, when the first image and the Nth second image are not of the same scene, the temporal white balance value of the first image is obtained by the aforementioned method according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value.

[0078] When the first image and the Nth second image are of the same scene, let the single-frame white balance value of the first image be wb_raw1, the single-frame white balance value of the Nth second image be wb_raw0, the temporal white balance value of the Nth second image be wb_t0, and the fusion weight of each frame of the second image in the storage space for the first image be w, then:

[0079] wb_new=(wb_raw0*rep+wb_raw1) / (rep+1)

[0080] Among them, wb_new is the updated single-frame white balance value of the Nth second image, which is wb_raw0, and rep is the number of repeated calculations, with an initial value of 0. Each time the calculation is performed, the value of rep is increased by 1. That is, this formula obtains the single-frame white balance value of the second image by averaging the single-frame white balance values ​​under the same scene.

[0081] After obtaining the single-frame white balance value wb_new of the second image, we have:

[0082] wb_new1=wb_t0+(wb_new-wb_raw0) / ∑w

[0083] Wherein, wb_new1 is the temporal white balance value of the first image after update, and ∑w is the sum of the fusion weights of each frame of the second image for the first image.

[0084] In an example of this embodiment, after obtaining the temporal white balance value of the first image, the method further includes: when the first image and the second image are of the same scene, keeping the second image stored in the storage space unchanged, updating the temporal white balance value of the second image to the temporal white balance value of the first image, and updating the single-frame white balance value of the second image to a new value fused with the single-frame white balance value of the first image. When the first image and the second image are not of the same scene, saving the information of the first image to the storage space, and when the number of images in the storage space is greater than the set number, removing the information of the second image with the earliest acquisition time from the storage space.

[0085] In an example of this embodiment, when the first image and the second image are of the same scene, the temporal white balance value of the second image is updated to the temporal white balance value of the first image, and the single-frame white balance value of the second image is updated to a new value that integrates the single-frame white balance value of the first image, that is, when the first image and the second image are of the same scene, the first image is not placed in the temporal cache queue, and only the temporal white balance value of the first image is updated to the storage space of the second image of the same scene. When the first image and the second image are not of the same scene, the first image is placed at the end of the temporal cache queue, that is, the position of the latest second image. If the number of temporal cache queues is greater than the preset upper limit, the earliest frame of the second image is removed, and the first image is placed at the end of the temporal cache queue.

[0086] In this example, the timing white balance value of the first image can be intelligently obtained, and the timing buffer queue and storage space can be updated according to whether the first image and the second image are the same scene. In this way, the timing buffer queue can be effectively managed, which facilitates the queue to collect data, reduces the performance and power consumption of the queue, and improves the user experience.

[0087] The white balance adjustment method provided in the embodiment of the present application can be executed by a white balance adjustment device. In the embodiment of the present application, the white balance adjustment method performed by the white balance adjustment device is taken as an example to illustrate the white balance adjustment device provided in the embodiment of the present application.

[0088] Figure 2 A block diagram of a white balance adjustment device according to an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the photographing device 100 includes a first acquisition module 110 , a fusion weight module 120 , a first obtaining module 130 and a result output module 140 .

[0089] The first acquisition module is used to obtain the first information and the first single-frame white balance value of the first image and the second information and the second single-frame white balance values ​​of N second images; the fusion weight module is used to obtain the fusion weight of the second image for the first image according to the first information and the second information; wherein the acquisition time of the second image is earlier than the acquisition time of the first image; the first acquisition module obtains the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value; the result output module is used to adjust the white balance of the first image according to the temporal white balance value to obtain the adjusted first image.

[0090] Optionally, the first obtaining module is also used to obtain the amount of information of the first image in the first information before obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image, and determine the prediction confidence of the first image according to the amount of information of the first image; when the prediction confidence of the first image is greater than or equal to the first threshold, perform the step of obtaining the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value; when the prediction confidence of the first image is less than the first threshold, compare the image feature information of the first image in the first information with the image feature information of the second image in the second information, and compare the autofocus information of the first image in the first information with the autofocus information of the second image in the second information, and determine whether the first image is included in the second image according to the comparison result, wherein the second image is the second image whose acquisition time is closest to the first image among the N second images; when the first image is not included in the second image, perform the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image.

[0091] Optionally, the fusion weight module includes: a first determination submodule, used to determine the prediction confidence of the second image based on the amount of information of the second image in the second information; and a first acquisition submodule, used to obtain the fusion weight of the second image for the first image based on the first information, the second information and the prediction confidence of the second image.

[0092] Optionally, the first acquisition module is further used to determine whether the first image and the second image are images of the same scene according to the first information of the first image and the second information of the second image after acquiring the first information and the first single-frame white balance value of the first image and the second information of the N second images; wherein the second image is the second image whose acquisition time is closest to the first image among the N second images. In the case that the first image and the second image are not images of the same scene, the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image is performed.

[0093] Optionally, the fusion weight module includes: a second determination submodule, used to determine the prediction confidence of the second image according to the amount of information of the second image in the second information, a third determination submodule, used to determine the similarity between the second image and the first image according to the scene information of the second image in the second information and the scene information of the first image in the first information; wherein the scene information includes image feature information and acquisition feature information, and the acquisition feature information includes at least one of acquisition viewing angle information and acquisition brightness information; a second acquisition submodule, used to obtain the fusion weight of the second image for the first image according to the prediction confidence of the second image and the similarity between the second image and the first image; the first acquisition module is also used to obtain a weighted average value of single-frame white balance according to the fusion weight of each second image in the N second images for the first image, the second single-frame white balance value of each second image, and the first single-frame white balance value, as the temporal white balance value of the first image.

[0094] In this example, a device is provided that can intelligently obtain the timing white balance value of the first image and update the timing buffer queue and storage space according to whether the first image and the second image are the same scene. In this way, the timing buffer queue can be effectively managed, which facilitates the queue to collect data, reduces the performance and power consumption of the queue, and improves the user experience.

[0095] The white balance adjustment device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0096] The white balance adjustment device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0097] The white balance adjustment device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0098] Alternatively, if Figure 3 As shown, the embodiment of the present application also provides an electronic device 400, including a processor 401 and a memory 402, and the memory 402 stores a program or instruction that can be executed on the processor 401. When the program or instruction is executed by the processor 401, the various steps of the above-mentioned white balance adjustment method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0099] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0100] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0101] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.

[0102] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0103] Among them, the processor 1010 is used to obtain first information and a first single-frame white balance value of a first image and second information and second single-frame white balance values ​​of N second images; obtain a fusion weight of the second image for the first image based on the first information and the second information; wherein the acquisition time of the second image is earlier than the acquisition time of the first image; obtain a temporal white balance value of the first image based on the fusion weight, the first single-frame white balance value and the second single-frame white balance value; and adjust the white balance of the first image according to the temporal white balance value to obtain an adjusted first image.

[0104] Optionally, the processor 1010, before obtaining the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value, further includes: obtaining the information amount of the first image in the first information; determining the prediction confidence of the first image according to the information amount of the first image; when the prediction confidence of the first image is greater than or equal to the first threshold, executing the step of obtaining the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value; when the prediction confidence of the first image is less than the first threshold, comparing the image feature information of the first image in the first information with the image feature information of the second image in the second information, and comparing the autofocus information of the first image in the first information with the autofocus information of the second image in the second information, and determining whether the first image is included in the second image according to the comparison result, wherein the second image is the second image whose acquisition time is closest to the first image among the N second images; when the first image is not included in the second image, executing the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image.

[0105] Optionally, processor 1010 is used to obtain a fusion weight of the second image for the first image based on the first information and the second information, including: determining a prediction confidence of the second image based on an amount of information of the second image in the second information; and obtaining a fusion weight of the second image for the first image based on the first information, the second information, and the prediction confidence of the second image.

[0106] Optionally, after the processor 1010 is used to obtain the first information and the first single-frame white balance value of the first image and the second information and the second single-frame white balance values ​​of N second images, the method also includes: determining whether the first image and the second image are images of the same scene based on the first information of the first image and the second information of the second image; wherein the second image is the second image whose acquisition time is closest to the first image among the N second images; and when the first image and the second image are not images of the same scene, executing the step of obtaining the temporal white balance value of the first image based on the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image.

[0107] Optionally, the processor 1010 is used to obtain a fusion weight of the second image for the first image based on the first information and the second information, including: determining a prediction confidence of the second image based on the amount of information of the second image in the second information; determining a similarity between the second image and the first image based on scene information of the second image in the second information and scene information of the first image in the first information; wherein the scene information includes image feature information and acquisition feature information, and the acquisition feature information includes at least one of acquisition viewing angle information and acquisition brightness information; obtaining a fusion weight of the second image for the first image based on the prediction confidence of the second image and the similarity between the second image and the first image; obtaining a temporal white balance value of the first image based on the fusion weight, the first single-frame white balance value and the second single-frame white balance value, including: obtaining a weighted average value of single-frame white balance as the temporal white balance value of the first image based on the fusion weight of each second image in the N second images for the first image, the second single-frame white balance value of each second image, and the first single-frame white balance value.

[0108] In this example, an electronic device is provided that can intelligently obtain the timing white balance value of the first image and update the timing buffer queue and storage space according to whether the first image and the second image are the same scene. In this way, the timing buffer queue can be effectively managed to facilitate queue data collection, reduce queue performance and power consumption, and enhance user experience.

[0109] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0110] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0111] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.

[0112] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned white balance adjustment method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0113] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0114] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned white balance adjustment method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0115] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0116] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned white balance adjustment method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0117] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0119] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A white balance adjustment method, characterized in that: The method comprises: Acquire first information and a first single-frame white balance value of a first image and second information and second single-frame white balance values ​​of N second images; Obtaining a fusion weight of the second image with respect to the first image according to the first information and the second information; wherein the acquisition time of the second image is earlier than the acquisition time of the first image; Obtaining a temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value, and the second single-frame white balance value; Performing white balance adjustment on the first image according to the temporal white balance value to obtain an adjusted first image; The obtaining, according to the first information and the second information, a fusion weight of the second image with respect to the first image includes: Determining a prediction confidence of the second image according to the information amount of the second image in the second information; Determine the similarity between the second image and the first image according to the scene information of the second image in the second information and the scene information of the first image in the first information; wherein the scene information includes image feature information and acquisition feature information, and the acquisition feature information includes at least one of acquisition viewing angle information and acquisition brightness information; Obtaining a fusion weight of the second image for the first image according to a prediction confidence of the second image and a similarity between the second image and the first image; Obtaining a temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value, and the second single-frame white balance value, comprising: According to the fusion weight of each second image in the N second images with respect to the first image, the second single-frame white balance value of each second image, and the first single-frame white balance value, a weighted average value of the single-frame white balance is obtained as the temporal white balance value of the first image.

2. The method according to claim 1, characterized in that Before obtaining the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value, the method further includes: Acquire the information amount of the first image in the first information; Determining a prediction confidence of the first image according to the information amount of the first image; When the prediction confidence of the first image is greater than or equal to a first threshold, performing the step of obtaining the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value, and the second single-frame white balance value; When the prediction confidence of the first image is less than the first threshold, compare the image feature information of the first image in the first information with the image feature information of the second image in the second information, and compare the autofocus information of the first image in the first information with the autofocus information of the second image in the second information, and determine whether the first image is included in the second image according to the comparison result, wherein the second image is a second image whose acquisition time is closest to the first image among the N second images; In the case that the first image is not included in the second image, the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image is performed.

3. The method according to claim 1, characterized in that The obtaining, according to the first information and the second information, a fusion weight of the second image with respect to the first image includes: determining a prediction confidence of the second image according to an amount of information of the second image in the second information; A fusion weight of the second image with respect to the first image is obtained according to the first information, the second information and the prediction confidence of the second image.

4. The method according to any one of claims 1 to 3, characterized in that After acquiring the first information and the first single-frame white balance value of the first image and the second information and the second single-frame white balance values ​​of the N second images, the method further includes: Determining, according to the first information of the first image and the second information of the second image, whether the first image and the second image are images of the same scene; wherein the second image is a second image whose acquisition time is closest to the first image among the N second images; In the case where the first image and the second image are not images of the same scene, the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image, and the single-frame white balance value of the second image is performed.

5. A white balance adjustment device, characterized in that: include: A first acquisition module, used for acquiring first information and a first single-frame white balance value of a first image and second information and second single-frame white balance values ​​of N second images; a fusion weight module, configured to obtain a fusion weight of the second image with respect to the first image according to the first information and the second information; wherein the acquisition time of the second image is earlier than the acquisition time of the first image; A first obtaining module, obtaining a temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value and the second single-frame white balance value; A result output module, configured to perform white balance adjustment on the first image according to the temporal white balance value to obtain an adjusted first image; The fusion weight module includes: A second determination submodule, used to determine the prediction confidence of the second image according to the information amount of the second image in the second information; a third determination submodule, configured to determine the similarity between the second image and the first image according to the scene information of the second image in the second information and the scene information of the first image in the first information; wherein the scene information includes image feature information and acquisition feature information, and the acquisition feature information includes at least one of acquisition viewing angle information and acquisition brightness information; a second obtaining submodule, configured to obtain a fusion weight of the second image with respect to the first image according to a prediction confidence of the second image and a similarity between the second image and the first image; The first acquisition module is also used to obtain a weighted average value of single-frame white balance as the temporal white balance value of the first image based on the fusion weight of each second image in the N second images with respect to the first image, the second single-frame white balance value of each second image, and the first single-frame white balance value.

6. The device according to claim 5, characterized in that The first obtaining module is further configured to obtain the information amount of the first image in the first information before obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image, and determine the prediction confidence of the first image according to the information amount of the first image; When the prediction confidence of the first image is greater than or equal to a first threshold, performing the step of obtaining the temporal white balance value of the first image according to the fusion weight, the first single-frame white balance value, and the second single-frame white balance value; When the prediction confidence of the first image is less than the first threshold, compare the image feature information of the first image in the first information with the image feature information of the second image in the second information, and compare the autofocus information of the first image in the first information with the autofocus information of the second image in the second information, and determine whether the first image is included in the second image according to the comparison result, wherein the second image is a second image whose acquisition time is closest to the first image among the N second images; In the case that the first image is not included in the second image, the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image and the single-frame white balance value of the second image is performed.

7. The device according to claim 5, characterized in that The fusion weight module includes: A first determination submodule, configured to determine a prediction confidence of the second image according to an amount of information of the second image in the second information; The first obtaining submodule is used to obtain a fusion weight of the second image with respect to the first image according to the first information, the second information and the prediction confidence of the second image.

8. The device according to any one of claims 5 to 7, characterized in that: The first obtaining module is further configured to determine whether the first image and the second image are images of the same scene according to the first information of the first image and the second information of the second image after acquiring the first information and the first single-frame white balance value of the first image and the second information and the second single-frame white balance value of the N second images; wherein the second image is the second image of the N second images whose acquisition time is closest to the first image; In the case where the first image and the second image are not images of the same scene, the step of obtaining the temporal white balance value of the first image according to the fusion weight, the single-frame white balance value of the first image, and the single-frame white balance value of the second image is performed.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the white balance adjustment method according to any one of claims 1 to 4 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the white balance adjustment method according to any one of claims 1 to 4 are implemented.