WO2019019904A1 - White balance processing method and apparatus, and terminal - Google Patents

White balance processing method and apparatus, and terminal Download PDF

Info

Publication number
WO2019019904A1
WO2019019904A1 PCT/CN2018/094971 CN2018094971W WO2019019904A1 WO 2019019904 A1 WO2019019904 A1 WO 2019019904A1 CN 2018094971 W CN2018094971 W CN 2018094971W WO 2019019904 A1 WO2019019904 A1 WO 2019019904A1
Authority
WO
WIPO (PCT)
Prior art keywords
current
camera
image
white balance
determining
Prior art date
Application number
PCT/CN2018/094971
Other languages
French (fr)
Chinese (zh)
Inventor
袁全
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019019904A1 publication Critical patent/WO2019019904A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control

Definitions

  • the present application relates to the field of camera technologies, and in particular, to a white balance processing method, apparatus, and terminal.
  • the two cameras can be switched according to the shooting environment parameters. For example, when the zoom ratio is zoomed from 1x to 2x, the wide-angle lens is switched to the telephoto lens.
  • the object of the present invention is to solve at least one of the above technical problems to some extent.
  • the present application proposes a white balance processing method, which adjusts the weight of each camera according to changes in the shooting environment parameters, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and AWB due to camera switching is avoided. Jumping phenomenon improves the user experience.
  • the present application also proposes a white balance processing device.
  • the application also proposes a terminal.
  • the application also proposes a computer readable storage medium.
  • the application also proposes a computer program product.
  • An embodiment of the present application provides a white balance processing method for a terminal that includes at least two different types of cameras.
  • the method includes:
  • the currently acquired image is subjected to white balance processing according to the current weight of each camera.
  • the white balance processing method provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • a further embodiment of the present application provides a white balance processing apparatus, wherein the white balance processing apparatus is applied to a terminal including at least two different types of cameras, the apparatus comprising:
  • the first determining module determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process
  • the processing module performs white balance processing on the currently acquired image according to the current weight of each camera.
  • the white balance processing device provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • a further aspect of the present application provides a terminal, including: a housing, a processor, a memory, a circuit board, a power supply circuit, and at least two different types of cameras, wherein the circuit board is disposed in the housing Internally, the processor and the memory are disposed on the circuit board; the power supply circuit is configured to supply power to each circuit or device of the terminal; the memory is configured to store executable program code; The processor runs a program corresponding to the executable program code by reading executable program code stored in the memory for executing the white balance processing method as described in the above embodiments.
  • the terminal provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • a further aspect of the present application provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the white balance processing method as described in the above embodiments.
  • the computer readable storage medium provided by the embodiment of the present application may be disposed in any terminal that includes at least two different types of cameras and needs white balance processing, and performs white balance processing method stored thereon when performing white balance processing.
  • the weight of each camera can be adjusted according to the change of the shooting environment parameters, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • a further aspect of the present application provides a computer program product for performing a white balance processing method as described in the foregoing embodiments when instructions in the computer program product are executed by a processor.
  • the computer program product provided by the embodiment of the present application can be set in any terminal that includes at least two different types of cameras, and needs to perform white balance adjustment.
  • the program corresponding to the white balance processing method can be implemented.
  • the weight of each camera is adjusted, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • FIG. 1 is a flow chart of a white balance processing method according to an embodiment of the present application.
  • FIG. 2 is a flow chart of a white balance processing method according to another embodiment of the present application.
  • FIG. 3 is a structural diagram of a white balance processing apparatus according to an embodiment of the present application.
  • FIG. 4 is a structural diagram of a white balance processing apparatus according to another embodiment of the present application.
  • FIG. 5 is a structural diagram of a terminal according to an embodiment of the present application.
  • Embodiments of the present application are directed to the related art.
  • the AWB settings of different cameras may be different, which causes an AWB jump to occur when switching from one camera to another.
  • a problem of poor user experience a white balance processing method is proposed.
  • the current weight of each camera corresponding to the current shooting environment parameter may be determined, so that the currently acquired image is white balanced according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • FIG. 1 is a flow chart of a white balance processing method according to an embodiment of the present application.
  • the method includes:
  • step 101 during the shooting, the current weight of each camera corresponding to the current shooting environment parameter is determined.
  • the white balance processing method provided by the embodiment of the present application may be performed by the white balance processing apparatus provided by the embodiment of the present application.
  • the white balance processing device can be configured in any terminal having at least two different types of cameras. Among them, there are many types of terminals, which can be selected according to application needs, such as mobile phones, computers, cameras, and the like.
  • the shooting environment parameter may include any one or more of a zoom factor, an object distance, a light source condition, and the like.
  • the sum of the current weights of each camera is 1.
  • step 101 can be implemented in the following manner:
  • the current weight of each camera is determined based on the current zoom factor, object distance, and/or light source conditions.
  • the light source condition refers to the intensity, angle, color and the like of the light.
  • the shooting environment parameters such as the zoom magnification, the object distance and/or the light source condition suitable for each camera may be determined according to the type of each camera in advance, and then the current shooting environment parameters and each are set according to the suitable shooting environment parameters of each camera.
  • the determined camera A suitable shooting environment parameters are: 1-6 times zoom magnification
  • the camera B suitable shooting environment parameter is: 6 times or more zoom magnification.
  • the current zoom factor can be set between 1-6 times, and when there is a large difference from the zoom factor of 6 times, for example, when the speed is less than 4.5 times, the weight of the camera A is 1, and the weight of the camera B is 0, and set the current zoom factor between 4.5-6 times, from low to high, the weight of camera B gradually increases, the weight of camera A gradually decreases until the weight of camera A is 0, the camera B's The weight is 1.
  • the weights corresponding to the camera A and the camera B are 1, 0 respectively; when the zoom magnification is 4.5-5 times, the weights corresponding to the camera A and the camera B are 0.8 and 0.2, respectively; When the zoom magnification is 5-5.5 times, the weights corresponding to camera A and camera B are 0.5 and 0.5 respectively; when the zoom magnification is 5.5-6 times, the weights corresponding to camera A and camera B are 0.2 and 0.8 respectively; When the multiple is 6 times or more, the weights corresponding to the camera A and the camera B are 0 and 1, respectively. Therefore, if the current shooting environment parameter is: 5.8 times the zoom magnification, it can be determined that the current weights of the camera A and the camera B corresponding to the current shooting environment parameters are 0.2 and 0.8, respectively.
  • the current zoom factor is set to be more than 6 times, and when there is a large difference with the zoom factor of 6 times, for example, when the signal is more than 8 times, the weight of the camera B is 1
  • the weight of the camera A is 0, and the current zoom factor is set between 6-8 times.
  • the weight of the camera A gradually increases, and the weight of the camera B gradually decreases until the weight of the camera A is 1.
  • the weight of camera B is 0.
  • the weights of the camera A and the camera B gradually increase or decrease the range of the shooting environment parameters corresponding to the process, and can be set as needed. For example, it can be set to a zoom ratio of 4.5-6 times, or a zoom factor of 6-8 times, or a zoom factor of 4.5-8 times. That is, it may be within the range of the shooting environment parameters suitable for the camera A, or may be within the range of the shooting environment parameters suitable for the camera B, or may be within the range of the shooting environment parameters suitable for the camera A and the camera B at the same time.
  • the process of increasing or decreasing the current weight of each camera may be linearly changed, or may be changed in a stepwise manner or other regular manner, and is not limited herein.
  • the process of increasing or decreasing the current weight of each camera, the slope when changing linearly, or the step size when changing stepwise can be set as needed. For example, if the zoom magnification is increased by 0.5 times, the weight corresponding to the camera A is decreased by 0.1, and the weight corresponding to the camera B is increased by 0.1; or, for every 0.5 times increase of the zoom magnification, the weight corresponding to the camera A is decreased by 0.2, and the corresponding to the camera B The weight is increased by 0.2, and so on.
  • the method may further include:
  • the current light source condition is determined according to the aperture size, shutter time, and sensitivity of each camera.
  • the zoom command and the image adjustment command may be automatically triggered by the terminal according to the shooting requirement, or may be manually triggered by the user according to the need, and is not limited herein.
  • the user performs an operation such as adjusting the magnification of the subject in the image according to the need, so that when the image adjustment instruction is triggered, the camera can adjust the current zoom factor according to the image adjustment instruction; Or, when the zoom command is acquired, the camera can adjust the current zoom factor according to the zoom command. Therefore, in the embodiment of the present application, the current zoom factor can be determined according to the zoom instruction or the image adjustment instruction.
  • the distance value of the distance sensor or the depth information contained in the currently acquired image will be different. Then, in the embodiment of the present application, the current object distance may be determined according to the output value of the distance sensor or the depth information included in the currently acquired image.
  • the current light source condition can be determined according to the aperture size, the shutter time, and the sensitivity of each camera.
  • the current weight of each camera can be determined according to the current zoom factor, object distance, and/or light source condition.
  • the light source condition may be an angle of the light.
  • the light in the current shooting scene may be from any direction in the three-dimensional space where the subject is the center of the sphere.
  • the angle of the light can be roughly divided into a smooth light, a back light, a side light, a side light, a side backlight, a top light, a bottom light, and the like.
  • the current ray angle can be determined in various ways.
  • the current ray angle is determined according to the color channel histogram corresponding to the currently acquired picture.
  • RGB data In practical applications, color channel histograms are usually acquired using RGB data. Therefore, in this embodiment, if the original image data of the currently acquired picture is not RGB data, it is necessary to first convert the non-RGB data into RGB data. Then, according to the RGB data, the color channel histogram corresponding to the currently collected picture is determined, which is not described in detail in this embodiment.
  • the RGB data acquired in this embodiment includes red (R), green (G), and blue (B) three color channels
  • the corresponding determined color channel histograms are three, respectively. It is a red channel histogram, a green channel histogram, and a blue channel histogram.
  • each color channel histogram determines the horizontal axis.
  • the vertical axis represents the pixel ratio of each pixel in the image at the brightness.
  • the corresponding determined color channel histogram is four, which are a red channel histogram and a green (Gr) channel histogram. , green (Gb) channel histogram and blue channel histogram.
  • the color channel histogram corresponding to the currently collected picture may include the correspondence between different brightness and pixel ratio under each color channel. Due to the different angles of light in the shooting scene, the proportions of pixels of different brightness in the currently acquired picture are different. Therefore, in the embodiment of the present application, the current ray angle can be determined according to the color channel histogram corresponding to the currently collected picture.
  • the brightness information of the current shooting scene may be obtained first, and then the pixel ratio threshold and the brightness threshold corresponding to the current shooting scene are determined according to the brightness information, and then according to the pixel ratio threshold, the brightness threshold, and the color channel histogram corresponding to the current shooting scene, Determine the angle of light in the current shooting scene.
  • the brightness information corresponding to the current shooting scene may be acquired from the automatic exposure control system.
  • the automatic exposure control system (Auto Exposure Control, AEC for short) can perform automatic exposure compensation processing on the captured image according to the brightness of the shooting scene, in actual application, when the terminal performs a shooting operation on the shooting area. Therefore, in this embodiment, the brightness information corresponding to the current shooting scene can be directly obtained from the AEC, so that the detection error of the shooting environment can be reduced, and the quality of the captured image can be improved.
  • the terminal may detect the shooting environment based on a color coding space (YUV).
  • YUV data is acquired after a series of processing by the Image Processor Processor (ISP), which causes the data in the YUV to not completely reflect the current shooting environment, resulting in
  • ISP Image Processor Processor
  • the original image data in the ISP may be used, such as the number of grids included in the image, the average brightness of each grid, and the grid.
  • the number of pixels included, the ratio of overexposed pixels included in each grid, and the like are used to determine the brightness information corresponding to the current environment.
  • the pixel ratio threshold and the brightness threshold corresponding to the current shooting scene may be determined according to the brightness information corresponding to the current shooting scene.
  • the same light angle has different features in different brightness shooting scenes, such as outdoor backlight scenes
  • the preview picture mainly shows that the dark part of the image is dark, the bright part is overexposed, and the night scene preview picture mainly shows Pixels are mainly concentrated in the dark part, and the overexposed area is small. Therefore, in order to make the pixel ratio threshold and the brightness threshold corresponding to the determined current shooting scene more accurate, the present application may perform a rough division of the shooting scene in advance, and respectively set the pixel ratio threshold and the brightness threshold for the divided scenes.
  • the shooting scene can be divided into three according to the brightness of the shooting scene, which are a high-brightness scene, a medium-brightness scene, and a low-brightness scene.
  • the high-brightness scene may be an area with good light such as outdoor, the medium-brightness scene may be a region with better indoor light, and the low-brightness scene may be a dark light or a region with poor night light, etc., which is not specifically limited in this application. .
  • the embodiment may further set the pixel ratio threshold and the brightness threshold for each scene.
  • the pixel ratio threshold and the brightness threshold of each of the above scenarios may be adaptively set according to actual usage requirements, which is not specifically limited in this application.
  • the embodiment may match the brightness information corresponding to the current shooting scene with each of the divided scenes.
  • the pixel ratio threshold and the brightness threshold corresponding to the current shooting scene are determined.
  • the target brightness range corresponding to the current shooting scene may be determined according to the corresponding relationship between the brightness threshold and the brightness range preset by each scene; and then the correspondence between the preset brightness range and the pixel ratio threshold and the brightness threshold is determined according to the preset brightness range. And determining a pixel ratio threshold and a brightness threshold corresponding to the target brightness range.
  • the target scene to which the current shooting scene belongs is determined according to the brightness range of the matching success, and then according to the target target.
  • the scene acquires a corresponding pixel ratio threshold and a brightness threshold.
  • the current ray angle may be determined according to the pixel ratio threshold, the brightness threshold, and the color channel histogram of the current preview scene.
  • the pixels in the histogram of each color channel are mostly concentrated in a position of high brightness or low brightness, and appear in a "double peak" form.
  • the angle of the light includes both forward and backlight.
  • the pixel ratio threshold may include two, which are a first pixel ratio threshold and a second pixel ratio threshold, respectively.
  • the brightness threshold also includes two, which are a first brightness threshold and a second brightness threshold, respectively.
  • the pixel ratio threshold and the brightness threshold are mutually corresponding, that is, the first pixel ratio threshold corresponds to the first brightness threshold, and the second pixel ratio threshold corresponds to the second brightness threshold.
  • the histogram of the current preview image can be used to determine whether the light angle in the current shooting scene is backlit. Specifically, it can be judged by the following methods:
  • the sum of the pixel ratio values in the histograms of the respective color channels is sequentially counted according to the direction of the brightness from low to high and from high to low;
  • the first brightness value corresponding to any color channel is smaller than the first brightness threshold, and the second brightness value is greater than the second brightness threshold, it is determined that the angle of the light in the shooting scene is back light. Otherwise, it is determined to be smooth.
  • the angle of the light may also include: side light, side back light, top light, etc., in order to make the angle of the determined light more accurate, for the same scene, the number and size of the pixel scale thresholds and the corresponding brightness threshold may be set as needed. , thereby determining the angle of the light in the current shooting scene according to the set pixel ratio threshold and the brightness threshold.
  • the angle of the light in the current shooting scene can be determined according to the current shooting time, position, and the like.
  • the location includes the geographic location where the terminal is located, the orientation of the terminal (refer to the shooting direction of the terminal), and the like. For example, at 12 noon in Beijing, the mobile phone is shooting towards the south. Because the sun is at the south at 12 o'clock in Beijing, the direction of the mobile phone is south, that is, the subject is between the sun and the terminal, that is, the light angle of the preview image of the camera is Backlighting.
  • the location of the terminal can be obtained according to a positioning system in the terminal, such as a Global Positioning System (GPS).
  • GPS Global Positioning System
  • the shooting time can be obtained from the clock on the terminal, and the orientation of the terminal can be based on the terminal.
  • the angle of the light is determined according to the direction of the shadow of the object to be photographed in the preview image, that is, the direction of the shadow.
  • the shadow in the preview image can be determined according to the contour extracted from the preview image and the position of the contour in the preview image. The direction of the shadow. Then, based on the direction of the shadow, the angle of the light in the current shooting scene is determined.
  • the current weight of each camera can be determined according to the angle of the light.
  • Step 102 Perform white balance processing on the currently acquired image according to the current weight of each camera.
  • each camera can be set to be in an open state during the shooting process, so that each camera can acquire an image. After each camera acquires the current image, white balance adjustment can be performed on each image, and each processed image is combined according to the current weight of each camera to generate a current captured image.
  • a camera with a weight of 0 may be set to be in a closed state, and a camera with a weight of not 0 may be in an activated state. Therefore, white balance adjustment is performed only on the image currently acquired by the camera whose weight is not 0, and each processed image is combined to generate a current captured image according to the current weight of each camera whose weight is not 0.
  • each camera can determine each target white balance gain value corresponding to each camera according to each color temperature value corresponding to each image, thereby performing white balance processing on each image according to each target white balance gain value. Finally, according to the current weight of each camera, the processed images are combined to generate the current captured image.
  • the weight of each camera is adjusted according to the change of the shooting environment parameter, thereby ensuring that an image suitable for the current environmental parameter can be obtained, and the camera switching is avoided.
  • the AWB hopping phenomenon has improved the user experience.
  • the white balance processing method provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • the current weight of each camera corresponding to the current shooting environment parameter can be determined, so that the currently acquired image is white balanced according to the current weight of each camera.
  • the process of performing white balance processing on the currently acquired image according to the current weight of each camera will be specifically described below with reference to FIG. 2 .
  • FIG. 2 is a flow chart of a white balance processing method according to another embodiment of the present application.
  • the white balance processing method is applied to a terminal including at least two different types of cameras, and the method includes:
  • Step 201 During the shooting process, determine the current weight of each camera corresponding to the current shooting environment parameter.
  • step 201 For the specific implementation process and the principle of the foregoing step 201, refer to the detailed description of step 101 in the foregoing embodiment, and details are not described herein again.
  • Step 202 Determine color temperature values corresponding to respective images currently acquired by each camera.
  • the color temperature values corresponding to the respective images currently acquired by each camera may be determined by using various methods.
  • the color temperature value corresponding to the currently acquired image may be determined according to the color temperature value corresponding to each white block in the image currently acquired by each camera; or, according to the image currently acquired by each camera, the area corresponding to the target shooting object The color temperature value determines the color temperature value corresponding to the currently acquired image, and so on.
  • Step 203 Determine, according to each color temperature value, a target white balance gain value corresponding to each camera.
  • the target white balance gain value is used to adjust the currently acquired image to the color in the image to be reproduced.
  • the target white balance gain value may include a target white balance gain value of three channels R, G, and B in the image acquired by the image sensor.
  • the color cast directions of the respective images can be determined, thereby calculating the target white balance gain values.
  • calculation, table lookup or iteration method may be used to calculate the target white balance gain values corresponding to the respective cameras.
  • the average of the three components R, G, and B in the color vector of all the pixels tends to be balanced (1:1:1), using weighting.
  • the grayscale algorithm can obtain a more accurate target white balance gain value.
  • the image currently acquired by each camera may be divided into several sub-blocks, and the color vector of all the pixels in each sub-block is obtained, and each pixel is represented by a (R, G, B) color vector, and then each sub-calculation is calculated.
  • the average and standard deviation of the three channels R, G, and B in the block and then weight the standard deviation of each sub-block (abandon the sub-block with low correlation and retain the sub-block with high correlation) to reduce the large block.
  • the effect of a single color makes the image colorful.
  • the average values of the three channels R, G, and B weighted by the standard deviation are calculated, and the gain coefficients of the three channels R, G, and B are finally calculated, that is, the target white balance gain value corresponding to the camera is obtained.
  • Step 204 Perform white balance processing on each image by using each target white balance value, and acquire each processed image.
  • the R value and the B value data of each pixel after the image adjustment currently obtained by each camera are calculated according to the calculated target white balance gain values, thereby realizing Color correction for each image.
  • the current camera since the human eye has the highest sensitivity to light (480 nm-600 nm) belonging to the green wavelength in the spectrum, and the Bayer array has the largest number of green pixels collected, the current camera usually adopts green.
  • the gain value of the component is fixed, and then the gain values of the red component and the blue component are respectively adjusted to achieve adjustment of the red component and the blue component.
  • Step 205 Synthesize each processed image to generate a current captured image according to the current weight of each camera.
  • the color saturation of each image after processing may be different, and then, in the embodiment of the present application, according to the processed Different color saturation of the image, using different synthesis modes, the processed images are combined to generate the current captured image.
  • the target composition mode can be determined based on the color saturation of each of the processed images, and the processed images can be combined to generate the current captured image based on the current weight of each camera based on the target composition mode.
  • the target synthesis mode is used to indicate a specific manner when the processed images are combined to generate a current captured image.
  • the color saturation threshold may be preset, so that the corresponding target synthesis mode is determined according to the relationship between the processed color saturation of each image and the preset color saturation threshold, based on the target synthesis mode, according to each camera current The weight of each of the processed images is combined.
  • the color saturation threshold may be preset to a value that is infinitely close to 0, so that each processed image is divided into a gray image and a color image, and when the color saturation of each image after the processing is determined to be less than a threshold, that is, each image
  • the processed images may be combined to generate a current captured image by using a grayscale weighted average method according to the current weight of each camera.
  • the synthesized image is F, it is possible, the image synthesized by the following equation.
  • each image when it is determined that the color saturation of each processed image is greater than a threshold, that is, when each image is a color image, each image may be regarded as three monochrome images (red, green, blue) according to the three primary color models. Superimposed, respectively, according to the current weight of each camera, the color images are synthesized, and finally the three red, green and blue monochrome images are synthesized, and then superimposed by three monochrome images to generate the current captured image.
  • a threshold that is, when each image is a color image
  • each image may be regarded as three monochrome images (red, green, blue) according to the three primary color models.
  • the color images are synthesized, and finally the three red, green and blue monochrome images are synthesized, and then superimposed by three monochrome images to generate the current captured image.
  • the synthesized image is F, it is possible, the image synthesized by the following equation.
  • F B (i,j) w 1 (i,j)N 1B (i,j)+w 2 (i,j)N 2B (i,j)+...+w M (i,j)N MB ( i, j).
  • R, G, and B respectively represent three primary colors of red, green, and blue
  • F R (i, j), F G (i, j), F B (i, j) are the values of the R, G, and B channels of the (i, j)th point of the synthesized image, respectively;
  • each image when the color saturation of each image after processing is greater than a threshold, that is, when each image is a color image, each image may be first converted into a grayscale image, and then gray weighted according to the current weight of each camera.
  • the averaging method combines the processed images to generate a current captured image.
  • the white balance processing method provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter, and then determines the color temperature values corresponding to the respective images currently acquired by each camera, and then according to each The color temperature value determines the target white balance gain value corresponding to each camera, and then performs white balance processing on each image by using each target white balance value, acquires each processed image, and finally processes each processed image according to the current weight of each camera.
  • the image is synthesized to generate the current captured image. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • Fig. 3 is a structural diagram of a white balance processing apparatus according to an embodiment of the present application.
  • the white balance processing apparatus is applied to a terminal including at least two different types of cameras, and the apparatus includes:
  • the first determining module 31 determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process
  • the processing module 32 performs white balance processing on the currently acquired image according to the current weight of each camera.
  • the white balance processing apparatus can perform the white balance processing method provided by the embodiment of the present application.
  • the white balance processing device can be configured in any terminal having at least two different types of cameras. Among them, there are many types of terminals, which can be selected according to application needs, such as mobile phones, computers, cameras, and the like.
  • the first determining module 31 is specifically configured to:
  • the current weight of each camera is determined based on the current zoom factor, object distance, and/or light source conditions.
  • the processing module 32 includes:
  • a first determining unit configured to determine color temperature values corresponding to each image currently acquired by each camera
  • a second determining unit configured to determine, according to the color temperature values, respective target white balance gain values corresponding to the cameras
  • An acquiring unit configured to perform white balance processing on each image by using each target white balance value, and acquire each processed image
  • the synthesizing unit is configured to synthesize the processed images to generate a current captured image according to the current weight of each camera.
  • the foregoing first determining unit is specifically configured to:
  • processing module 32 further includes:
  • a third determining unit configured to determine a target synthesis mode according to the color saturation of each processed image
  • the processed images are combined to generate a current captured image according to the current weight of each camera.
  • the foregoing third determining unit is specifically configured to:
  • the processed images are combined to generate a current captured image by using a gray weighted average method according to the current weight of each camera;
  • each monochrome image is synthesized according to the three primary color models; and the combined three monochrome images are superimposed Generate the current captured image.
  • the white balance processing device provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • Fig. 4 is a structural diagram of a white balance processing apparatus according to another embodiment of the present application.
  • the white balance processing apparatus further includes:
  • a second determining module 41 configured to determine the current zoom factor according to the acquired zoom instruction or image adjustment instruction
  • And/or configured to determine a current object distance according to an output value of the distance sensor or depth information included in the currently acquired image
  • the light source condition is an angle of the light
  • the foregoing second determining module 41 is further configured to:
  • the white balance processing device provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • a further embodiment of the present application further provides a terminal.
  • FIG. 5 is a structural diagram of a terminal according to an embodiment of the present application.
  • Figure 5 shows the terminal as a mobile phone.
  • the terminal includes a housing 501, a processor 502, a memory 503, a circuit board 504, a power supply circuit 505, and at least two different types of cameras, which are illustrated by including two cameras 506 and 507.
  • the circuit board 504 is disposed inside the space enclosed by the housing 501, the processor 502 and the memory 503 are disposed on the circuit board 504; the power supply circuit 505 is used to supply power to each circuit or device of the terminal; and the memory 503 is used for storing
  • the program code is executed by the processor 502 by executing the executable program code stored in the memory 503 to execute a program corresponding to the executable program code for performing the white balance processing method as in the foregoing embodiment, the white balance processing Methods include:
  • the currently acquired image is subjected to white balance processing according to the current weight of each camera.
  • the terminal provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • Still another embodiment of the present application proposes a computer readable storage medium having stored thereon a computer program that, when executed by the processor, implements a white balance processing method as in the foregoing embodiments.
  • the computer readable storage medium provided by the embodiment of the present application may be disposed in any terminal that includes at least two different types of cameras and needs white balance adjustment, and performs white balance processing method stored thereon when performing white balance adjustment.
  • the weight of each camera can be adjusted according to the change of the shooting environment parameters, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • a further aspect of the present application is directed to a computer program product that, when executed by a processor, executes a white balance processing method as in the previous embodiments.
  • the computer program product provided by the embodiment of the present application can be set in any terminal that includes at least two different types of cameras, and needs to perform white balance adjustment.
  • the program corresponding to the white balance processing method can be implemented.
  • the weight of each camera is adjusted, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
  • a "computer-readable medium” can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device.
  • computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM).
  • the computer readable medium may even be a paper or other suitable medium on which the program can be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, other suitable The method is processed to obtain the program electronically and then stored in computer memory.
  • portions of the application can be implemented in hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

Landscapes

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

Abstract

Disclosed by the present application are a white balance processing method and apparatus, and a terminal, said method being applied to a terminal comprising at least two different types of cameras, the method comprising: during the process of photographing, determining the current weight of each camera corresponding to current photographing environment parameters; and carrying out white balance processing on a currently acquired image according to the current weight of each camera. Hence, by means of adjusting the weight of each camera according to changes in photographing environment parameters, not only is it ensured that an image which suits current environment parameters may be obtained, but auto white balance (AWB) jump that is brought about by switching cameras is also prevented, thus improving user experience.

Description

白平衡处理方法、装置和终端White balance processing method, device and terminal
相关申请的交叉引用Cross-reference to related applications
本申请要求广东欧珀移动通信有限公司于2017年7月25日提交的、申请名称为“白平衡处理方法、装置和终端”的、中国专利申请号“201710612896.2”的优先权。This application claims the priority of the Chinese patent application number "201710612896.2" filed on July 25, 2017 by Guangdong Opal Mobile Communications Co., Ltd., which is entitled "White Balance Processing Method, Apparatus and Terminal".
技术领域Technical field
本申请涉及摄像技术领域,尤其涉及一种白平衡处理方法、装置和终端。The present application relates to the field of camera technologies, and in particular, to a white balance processing method, apparatus, and terminal.
背景技术Background technique
随着科技的发展,相机、摄像机等摄像装置被广泛应用于人们的日常生活、工作、学习中,在人们生活中扮演的角色越来越重要。利用摄像装置拍摄图像时,为了保证图像场景中的色彩的真实重现,必须对白平衡进行控制。With the development of technology, camera devices, cameras and other camera devices are widely used in people's daily life, work, and learning, and the role played in people's lives is becoming more and more important. When taking pictures with the camera, in order to ensure the true reproduction of colors in the image scene, the white balance must be controlled.
相关技术,在终端中包括两个摄像头时,可以根据拍摄环境参数,进行两个摄像头的切换。比如,在变焦倍数从1倍到2倍做变焦操作的时候,会从广角镜头切换到长焦镜头。Related art, when two cameras are included in the terminal, the two cameras can be switched according to the shooting environment parameters. For example, when the zoom ratio is zoomed from 1x to 2x, the wide-angle lens is switched to the telephoto lens.
但是,由于不同摄像头的自动白平衡(Auto White Balance,简称AWB)设置会有差异,这就导致了从一个摄像头切换到另一个摄像头的瞬间,会发生AWB的跳变,用户体验差。However, due to the difference in the Auto White Balance (AWB) settings of different cameras, this causes an AWB jump and a poor user experience when switching from one camera to another.
发明内容Summary of the invention
本发明的目的旨在至少在一定程度上解决上述的技术问题之一。The object of the present invention is to solve at least one of the above technical problems to some extent.
为此,本申请提出一种白平衡处理方法,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。To this end, the present application proposes a white balance processing method, which adjusts the weight of each camera according to changes in the shooting environment parameters, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and AWB due to camera switching is avoided. Jumping phenomenon improves the user experience.
本申请还提出一种白平衡处理装置。The present application also proposes a white balance processing device.
本申请还提出一种终端。The application also proposes a terminal.
本申请还提出一种计算机可读存储介质。The application also proposes a computer readable storage medium.
本申请还提出一种计算机程序产品。The application also proposes a computer program product.
本申请一方面实施例提出一种白平衡处理方法,应用于包含至少两种不同类型摄像头 的终端中,所述方法包括:An embodiment of the present application provides a white balance processing method for a terminal that includes at least two different types of cameras. The method includes:
在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重;During the shooting process, determining the current weight of each camera corresponding to the current shooting environment parameter;
根据所述各摄像头当前的权重,对当前获取的图像进行白平衡处理。The currently acquired image is subjected to white balance processing according to the current weight of each camera.
本申请实施例提供的白平衡处理方法,首先在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重,然后根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The white balance processing method provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
本申请又一方面实施例提出一种白平衡处理装置,其中,所述白平衡处理装置,应用于包括至少两种不同类型摄像头的终端中,所述装置包括:A further embodiment of the present application provides a white balance processing apparatus, wherein the white balance processing apparatus is applied to a terminal including at least two different types of cameras, the apparatus comprising:
第一确定模块,由于在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重;The first determining module determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process;
处理模块,由于根据所述各摄像头当前的权重,对当前获取的图像进行白平衡处理。The processing module performs white balance processing on the currently acquired image according to the current weight of each camera.
本申请实施例提供的白平衡处理装置,首先在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重,然后根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The white balance processing device provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
本申请又一方面实施例提出一种终端,包括:壳体、处理器、存储器、电路板、电源电路和至少两种不同类型的摄像头,其中,所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上;所述电源电路,用于为所述终端的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过读取所述存储器中存储的可执行程序代码,来运行与所述可执行程序代码对应的程序,以用于执行如上述实施例所述的白平衡处理方法。A further aspect of the present application provides a terminal, including: a housing, a processor, a memory, a circuit board, a power supply circuit, and at least two different types of cameras, wherein the circuit board is disposed in the housing Internally, the processor and the memory are disposed on the circuit board; the power supply circuit is configured to supply power to each circuit or device of the terminal; the memory is configured to store executable program code; The processor runs a program corresponding to the executable program code by reading executable program code stored in the memory for executing the white balance processing method as described in the above embodiments.
本申请实施例提供的终端,首先在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重,然后根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The terminal provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
本申请又一方面实施例提出一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述实施例所述的白平衡处理方法。A further aspect of the present application provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the white balance processing method as described in the above embodiments.
本申请实施例提供的计算机可读存储介质,可以设置在任意包括至少两种不同类型摄像头,需要进行白平衡处理的终端中,在进行白平衡处理时,通过执行其上存储的白平衡处理方法,可以实现根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The computer readable storage medium provided by the embodiment of the present application may be disposed in any terminal that includes at least two different types of cameras and needs white balance processing, and performs white balance processing method stored thereon when performing white balance processing. The weight of each camera can be adjusted according to the change of the shooting environment parameters, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
本申请又一方面实施例提出一种计算机程序产品,当所述计算机程序产品中的指令由处理器执行时,执行如前述实施例所述的白平衡处理方法。A further aspect of the present application provides a computer program product for performing a white balance processing method as described in the foregoing embodiments when instructions in the computer program product are executed by a processor.
本申请实施例提供的计算机程序产品,可以设置在任意包括至少两种不同类型摄像头,需要进行白平衡调节的终端中,在进行白平衡调节时,通过执行对应白平衡处理方法的程序,可以实现根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The computer program product provided by the embodiment of the present application can be set in any terminal that includes at least two different types of cameras, and needs to perform white balance adjustment. When performing white balance adjustment, the program corresponding to the white balance processing method can be implemented. According to the change of the shooting environment parameters, the weight of each camera is adjusted, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
本申请附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。The aspects and advantages of the present invention will be set forth in part in the description which follows.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained from those skilled in the art without any creative work.
图1是本申请一个实施例的白平衡处理方法的流程图;1 is a flow chart of a white balance processing method according to an embodiment of the present application;
图2是本申请另一个实施例的白平衡处理方法的流程图;2 is a flow chart of a white balance processing method according to another embodiment of the present application;
图3是本申请一个实施例的白平衡处理装置的结构图;3 is a structural diagram of a white balance processing apparatus according to an embodiment of the present application;
图4是本申请另一个实施例的白平衡处理装置的结构图;4 is a structural diagram of a white balance processing apparatus according to another embodiment of the present application;
图5是本申请一个实施例的终端的结构图。FIG. 5 is a structural diagram of a terminal according to an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图对本申请实施例一种双摄像头的控制方法和装置进行详细描述。A method and apparatus for controlling a dual camera according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它 实施例,都属于本申请保护的范围。It should be understood that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
下面参考附图描述本申请实施例的白平衡处理方法、装置和终端。A white balance processing method, apparatus, and terminal according to an embodiment of the present application will be described below with reference to the accompanying drawings.
本申请各实施例针对相关技术中,终端中包括两个摄像头时,由于不同摄像头的AWB设置会有差异,这就导致了从一个摄像头切换到另一个摄像头的瞬间,会发生AWB的跳变,用户体验差的问题,提出一种白平衡处理方法。Embodiments of the present application are directed to the related art. When two cameras are included in the terminal, the AWB settings of different cameras may be different, which causes an AWB jump to occur when switching from one camera to another. A problem of poor user experience, a white balance processing method is proposed.
本申请实施例提出的白平衡处理方法,在拍摄过程中,可以确定与当前的拍摄环境参数对应的各摄像头当前的权重,从而根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。In the white balance processing method proposed by the embodiment of the present application, during the shooting process, the current weight of each camera corresponding to the current shooting environment parameter may be determined, so that the currently acquired image is white balanced according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
下面结合图1对本申请实施例的白平衡处理方法进行说明。The white balance processing method of the embodiment of the present application will be described below with reference to FIG.
图1是本申请一个实施例的白平衡处理方法的流程图。1 is a flow chart of a white balance processing method according to an embodiment of the present application.
如图1所示,该方法包括:As shown in Figure 1, the method includes:
步骤101,在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重。In step 101, during the shooting, the current weight of each camera corresponding to the current shooting environment parameter is determined.
具体的,本申请实施例提供的白平衡处理方法,可以由本申请实施例提供的白平衡处理装置执行。具体的,该白平衡处理装置,可以被配置在任意具有至少两种不同类型摄像头的终端中。其中,终端的类型很多,可以根据应用需要进行选择,例如:手机、电脑、相机等。Specifically, the white balance processing method provided by the embodiment of the present application may be performed by the white balance processing apparatus provided by the embodiment of the present application. Specifically, the white balance processing device can be configured in any terminal having at least two different types of cameras. Among them, there are many types of terminals, which can be selected according to application needs, such as mobile phones, computers, cameras, and the like.
其中,拍摄环境参数,可以包括变焦倍数、物距、光源条件等中的任意一个或多个。The shooting environment parameter may include any one or more of a zoom factor, an object distance, a light source condition, and the like.
各摄像头当前的权重之和为1。The sum of the current weights of each camera is 1.
相应的,步骤101可以通过以下方式实现:Correspondingly, step 101 can be implemented in the following manner:
根据当前的变焦倍数、物距和/或光源条件,确定各摄像头当前的权重。The current weight of each camera is determined based on the current zoom factor, object distance, and/or light source conditions.
其中,光源条件,指光线的强弱、角度、色彩等。Among them, the light source condition refers to the intensity, angle, color and the like of the light.
具体实现时,可以预先根据各摄像头的类型,确定各摄像头适合的变焦倍数、物距和/或光源条件等拍摄环境参数,进而根据各摄像头适合的拍摄环境参数,设置当前的拍摄环境参数与各摄像头的权重的映射关系。从而在拍摄过程中,确定当前的拍摄环境参数后,可以根据预设的映射关系,确定与当前的拍摄环境参数对应的各摄像头当前的权重。In the specific implementation, the shooting environment parameters such as the zoom magnification, the object distance and/or the light source condition suitable for each camera may be determined according to the type of each camera in advance, and then the current shooting environment parameters and each are set according to the suitable shooting environment parameters of each camera. The mapping relationship of the weight of the camera. Therefore, after the current shooting environment parameter is determined during the shooting process, the current weight of each camera corresponding to the current shooting environment parameter may be determined according to the preset mapping relationship.
举例来说,假设终端中包括摄像头A和摄像头B,确定的摄像头A适合的拍摄环境参数为:1-6倍的变焦倍数,摄像头B适合的拍摄环境参数为:6倍以上的变焦倍数。则可以根据上述拍摄环境参数,设置当前的变焦倍数在1-6倍之间,且与6倍的变焦倍数相差较 多时,比如在4.5倍以下时,摄像头A的权重为1,摄像头B的权重为0,并设置当前的变焦倍数在4.5-6倍之间,从低到高变化时,摄像头B的权重逐渐增加,摄像头A的权重逐渐减小,直至摄像头A的权重为0,摄像头B的权重为1。For example, assuming that the camera includes the camera A and the camera B, the determined camera A suitable shooting environment parameters are: 1-6 times zoom magnification, and the camera B suitable shooting environment parameter is: 6 times or more zoom magnification. According to the above shooting environment parameters, the current zoom factor can be set between 1-6 times, and when there is a large difference from the zoom factor of 6 times, for example, when the speed is less than 4.5 times, the weight of the camera A is 1, and the weight of the camera B is 0, and set the current zoom factor between 4.5-6 times, from low to high, the weight of camera B gradually increases, the weight of camera A gradually decreases until the weight of camera A is 0, the camera B's The weight is 1.
比如,在变焦倍数为1-4.5倍时,摄像头A和摄像头B对应的权重分别为1、0;在变焦倍数为4.5-5倍时,摄像头A和摄像头B对应的权重分别为0.8、0.2;在变焦倍数为5-5.5倍时,摄像头A和摄像头B对应的权重分别为0.5、0.5;在变焦倍数为5.5-6倍时,摄像头A和摄像头B对应的权重分别为0.2、0.8;在变焦倍数为6倍以上时,摄像头A和摄像头B对应的权重分别为0、1。从而若当前的拍摄环境参数为:5.8倍的变焦倍数,则可以确定与当前的拍摄环境参数对应的摄像头A和摄像头B当前的权重分别为0.2、0.8。For example, when the zoom magnification is 1-4.5 times, the weights corresponding to the camera A and the camera B are 1, 0 respectively; when the zoom magnification is 4.5-5 times, the weights corresponding to the camera A and the camera B are 0.8 and 0.2, respectively; When the zoom magnification is 5-5.5 times, the weights corresponding to camera A and camera B are 0.5 and 0.5 respectively; when the zoom magnification is 5.5-6 times, the weights corresponding to camera A and camera B are 0.2 and 0.8 respectively; When the multiple is 6 times or more, the weights corresponding to the camera A and the camera B are 0 and 1, respectively. Therefore, if the current shooting environment parameter is: 5.8 times the zoom magnification, it can be determined that the current weights of the camera A and the camera B corresponding to the current shooting environment parameters are 0.2 and 0.8, respectively.
类似的,可以根据摄像头A和B分别适合的拍摄环境参数,设置当前的变焦倍数在6倍以上,且与6倍的变焦倍数相差较多时,比如在8倍以上时,摄像头B的权重为1,摄像头A的权重为0,并设置当前的变焦倍数在6-8倍之间,从高到低变化时,摄像头A的权重逐渐增加,摄像头B的权重逐渐减小,直至摄像头A的权重为1,摄像头B的权重为0。Similarly, according to the suitable shooting environment parameters of the cameras A and B respectively, the current zoom factor is set to be more than 6 times, and when there is a large difference with the zoom factor of 6 times, for example, when the signal is more than 8 times, the weight of the camera B is 1 The weight of the camera A is 0, and the current zoom factor is set between 6-8 times. When changing from high to low, the weight of the camera A gradually increases, and the weight of the camera B gradually decreases until the weight of the camera A is 1. The weight of camera B is 0.
需要说明的是,摄像头A和摄像头B的权重逐渐增加或减小过程对应的拍摄环境参数的范围,可以根据需要设置。比如,可以设置为变焦倍数在4.5-6倍之间,也可以设置为变焦倍数在6-8倍之间,还可以设置为变焦倍数在4.5-8倍之间。即,可以仅在摄像头A适合的拍摄环境参数范围内,也可以仅在摄像头B适合的拍摄环境参数范围内,也可以同时在摄像头A和摄像头B适合的拍摄环境参数范围内。It should be noted that the weights of the camera A and the camera B gradually increase or decrease the range of the shooting environment parameters corresponding to the process, and can be set as needed. For example, it can be set to a zoom ratio of 4.5-6 times, or a zoom factor of 6-8 times, or a zoom factor of 4.5-8 times. That is, it may be within the range of the shooting environment parameters suitable for the camera A, or may be within the range of the shooting environment parameters suitable for the camera B, or may be within the range of the shooting environment parameters suitable for the camera A and the camera B at the same time.
另外,随着当前的拍摄环境参数的变化,各摄像头当前的权重增加或减小的过程,可以是呈线性变化的,也可以是呈阶梯状变化、或其它规律变化的,此处不作限制。In addition, as the current shooting environment parameters change, the process of increasing or decreasing the current weight of each camera may be linearly changed, or may be changed in a stepwise manner or other regular manner, and is not limited herein.
且,各摄像头当前的权重的增加或减小过程,呈线性变化时的斜率,或呈阶梯状变化时的步长,可以根据需要设置。比如,可以设置变焦倍数每增加0.5倍,摄像头A对应的权重减小0.1,摄像头B对应的权重增加0.1;或者,变焦倍数每增加0.5倍,摄像头A对应的权重减小0.2,摄像头B对应的权重增加0.2,等等。Moreover, the process of increasing or decreasing the current weight of each camera, the slope when changing linearly, or the step size when changing stepwise, can be set as needed. For example, if the zoom magnification is increased by 0.5 times, the weight corresponding to the camera A is decreased by 0.1, and the weight corresponding to the camera B is increased by 0.1; or, for every 0.5 times increase of the zoom magnification, the weight corresponding to the camera A is decreased by 0.2, and the corresponding to the camera B The weight is increased by 0.2, and so on.
可以理解的是,在根据当前的变焦倍数、物距和/或光源条件,确定各摄像头当前的权重之前,还需要确定当前的变焦倍数、物距和/或光源条件。即,在步骤101之前,还可以包括:It can be understood that before determining the current weight of each camera according to the current zoom factor, object distance and/or light source condition, it is also necessary to determine the current zoom factor, object distance and/or light source condition. That is, before step 101, the method may further include:
根据获取的变焦指令或图像调节指令,确定当前的变焦倍数;Determining the current zoom factor according to the obtained zoom instruction or image adjustment instruction;
和/或,根据距离传感器的输出值或者当前获取的图像中包含的深度信息,确定当前的 物距;And/or determining the current object distance according to the output value of the distance sensor or the depth information included in the currently acquired image;
和/或,根据各摄像头的光圈大小、快门时间及感光度,确定当前的光源条件。And/or, the current light source condition is determined according to the aperture size, shutter time, and sensitivity of each camera.
其中,变焦指令和图像调节指令,可以是终端根据拍摄需要,自动触发产生的指令;也可以是用户根据需要,手动触发产生的指令,此处不作限制。The zoom command and the image adjustment command may be automatically triggered by the terminal according to the shooting requirement, or may be manually triggered by the user according to the need, and is not limited herein.
具体的,在拍摄过程中,用户根据需要,执行如调整图像中被拍摄物的放大倍数等的操作,从而触发产生图像调节指令时,摄像头可以根据图像调节指令,对当前的变焦倍数进行调整;或者,在获取到变焦指令时,摄像头可以根据变焦指令,对当前的变焦倍数进行调整。从而,在本申请实施例中,可以根据变焦指令或图像调节指令,确定当前的变焦倍数。Specifically, during the shooting process, the user performs an operation such as adjusting the magnification of the subject in the image according to the need, so that when the image adjustment instruction is triggered, the camera can adjust the current zoom factor according to the image adjustment instruction; Or, when the zoom command is acquired, the camera can adjust the current zoom factor according to the zoom command. Therefore, in the embodiment of the present application, the current zoom factor can be determined according to the zoom instruction or the image adjustment instruction.
若在拍摄过程中,物距不同,相应的,距离传感器的输出值或当前获取的图像中包含的深度信息也会不同。那么,在本申请实施例中,可以根据距离传感器的输出值或者当前获取的图像中包含的深度信息,确定当前的物距。If the object distance is different during the shooting, the distance value of the distance sensor or the depth information contained in the currently acquired image will be different. Then, in the embodiment of the present application, the current object distance may be determined according to the output value of the distance sensor or the depth information included in the currently acquired image.
若在拍摄过程中,光源条件不同,比如当前光线较暗或较亮时,相应的,各摄像头的光圈大小、快门时间及感光度也会不同。那么,在本申请实施例中,可以根据各摄像头的光圈大小、快门时间及感光度,确定当前的光源条件。If the light source conditions are different during shooting, such as when the current light is dark or bright, the aperture size, shutter time and sensitivity of each camera will be different. Then, in the embodiment of the present application, the current light source condition can be determined according to the aperture size, the shutter time, and the sensitivity of each camera.
具体的,确定了当前的变焦倍数、物距和/或光源条件后,即可根据当前的变焦倍数、物距和/或光源条件,确定各摄像头当前的权重。Specifically, after determining the current zoom factor, object distance, and/or light source condition, the current weight of each camera can be determined according to the current zoom factor, object distance, and/or light source condition.
在本申请实施例一种可能的实现形式中,光源条件可以为光线的角度。其中,当前拍摄场景中光线可以来自于被摄主体为球心的三维空间中的任意方向。本实施例中,光线的角度可大致分为顺光、逆光、侧光、侧顺光、侧逆光、顶光、底光等。In a possible implementation form of the embodiment of the present application, the light source condition may be an angle of the light. The light in the current shooting scene may be from any direction in the three-dimensional space where the subject is the center of the sphere. In this embodiment, the angle of the light can be roughly divided into a smooth light, a back light, a side light, a side light, a side backlight, a top light, a bottom light, and the like.
具体的,可以通过以下多种方式,确定当前的光线角度。Specifically, the current ray angle can be determined in various ways.
方式一method one
根据当前采集的画面对应的各颜色通道直方图,确定当前的光线角度。The current ray angle is determined according to the color channel histogram corresponding to the currently acquired picture.
首先,可以先确定当前采集的画面即预览画面对应的各颜色通道直方图。First, it is possible to first determine the currently collected picture, that is, the color channel histogram corresponding to the preview picture.
在实际应用中,颜色通道直方图通常是利用RGB数据进行获取。因此本实施例中,若当前采集的画面的原始图像数据不是RGB数据,则需要先将非RGB数据转为RGB数据。然后,再根据RGB数据,确定出当前采集的画面对应的各颜色通道直方图,本实施例对此不作过多赘述。In practical applications, color channel histograms are usually acquired using RGB data. Therefore, in this embodiment, if the original image data of the currently acquired picture is not RGB data, it is necessary to first convert the non-RGB data into RGB data. Then, according to the RGB data, the color channel histogram corresponding to the currently collected picture is determined, which is not described in detail in this embodiment.
需要说明的是,若本实施例中获取的RGB数据中包括红(R)、绿(G)、蓝(B)三个颜色通道,那么对应确定的各颜色通道直方图则为三个,分别为红色通道直方图、绿色通道直方 图以及蓝色通道直方图。It should be noted that if the RGB data acquired in this embodiment includes red (R), green (G), and blue (B) three color channels, the corresponding determined color channel histograms are three, respectively. It is a red channel histogram, a green channel histogram, and a blue channel histogram.
进一步地,上述确定的三种颜色通道直方图。其中,各颜色通道直方图中,横轴表示图像亮度,纵轴表示图像中各像素位于该亮度下的像素比例。Further, the three color channel histograms determined above. Wherein, in each color channel histogram, the horizontal axis represents the image brightness, and the vertical axis represents the pixel ratio of each pixel in the image at the brightness.
若本实施例中获取的RGB数据包括R,Gr,Gb,B四个颜色通道时,那么对应确定的颜色通道直方图则为四个,分别为红色通道直方图、绿色(Gr)通道直方图、绿色(Gb)通道直方图以及蓝色通道直方图。If the RGB data acquired in this embodiment includes four color channels of R, Gr, Gb, and B, then the corresponding determined color channel histogram is four, which are a red channel histogram and a green (Gr) channel histogram. , green (Gb) channel histogram and blue channel histogram.
可以理解的是,上述当前采集的画面对应的各颜色通道直方图,可包括各颜色通道下的不同亮度与像素比例的对应关系。由于拍摄场景中光线的角度不同,当前采集的画面中不同亮度的像素所占的比例不同。由此,本申请实施例中,可以根据当前采集的画面对应的各颜色通道直方图,确定当前的光线角度。It can be understood that the color channel histogram corresponding to the currently collected picture may include the correspondence between different brightness and pixel ratio under each color channel. Due to the different angles of light in the shooting scene, the proportions of pixels of different brightness in the currently acquired picture are different. Therefore, in the embodiment of the present application, the current ray angle can be determined according to the color channel histogram corresponding to the currently collected picture.
具体的,可以先获取当前拍摄场景的亮度信息,然后根据亮度信息确定当前拍摄场景对应的像素比例阈值及亮度阈值,进而根据当前拍摄场景对应的像素比例阈值、亮度阈值及各颜色通道直方图,确定当前拍摄场景下的光线角度。Specifically, the brightness information of the current shooting scene may be obtained first, and then the pixel ratio threshold and the brightness threshold corresponding to the current shooting scene are determined according to the brightness information, and then according to the pixel ratio threshold, the brightness threshold, and the color channel histogram corresponding to the current shooting scene, Determine the angle of light in the current shooting scene.
具体实现时,可以先从自动曝光控制系统中,获取与当前拍摄场景对应的亮度信息。In the specific implementation, the brightness information corresponding to the current shooting scene may be acquired from the automatic exposure control system.
由于在实际应用中,利用终端对拍摄区域进行拍摄操作时,自动曝光控制系统(Auto Exposure Control,简称为:AEC)可以根据拍摄场景的亮度,对拍摄画面进行自动曝光补偿处理。因此本实施例中,可直接从AEC中获取与当前拍摄场景对应的亮度信息,从而可以减少对拍摄环境的检测误差,提高拍摄图像的质量。Since the automatic exposure control system (Auto Exposure Control, AEC for short) can perform automatic exposure compensation processing on the captured image according to the brightness of the shooting scene, in actual application, when the terminal performs a shooting operation on the shooting area. Therefore, in this embodiment, the brightness information corresponding to the current shooting scene can be directly obtained from the AEC, so that the detection error of the shooting environment can be reduced, and the quality of the captured image can be improved.
或者,终端可基于颜色编码空间(YUV)对拍摄环境进行检测。但是,YUV数据是经过图像处理器(Image Signal Processor,简称为:ISP)进行一系列的处理后获取的,这就会造成YUV中的数据并不能完全真实的反映当前的拍摄环境,从而导致对拍摄环境的检测出现误差,影响拍摄图像的质量,因此,本实施例中,可以根据ISP中的原始图像数据,比如图像中包括的网格数量、每个网格的平均亮度、各网格中包括的像素数、各网格包括的过曝光像素比例等等,来确定当前环境对应的亮度信息。Alternatively, the terminal may detect the shooting environment based on a color coding space (YUV). However, the YUV data is acquired after a series of processing by the Image Processor Processor (ISP), which causes the data in the YUV to not completely reflect the current shooting environment, resulting in The detection of the shooting environment has an error, which affects the quality of the captured image. Therefore, in this embodiment, the original image data in the ISP may be used, such as the number of grids included in the image, the average brightness of each grid, and the grid. The number of pixels included, the ratio of overexposed pixels included in each grid, and the like are used to determine the brightness information corresponding to the current environment.
然后,可以根据当前拍摄场景对应的亮度信息,确定当前拍摄场景对应的像素比例阈值及亮度阈值。Then, the pixel ratio threshold and the brightness threshold corresponding to the current shooting scene may be determined according to the brightness information corresponding to the current shooting scene.
需要说明的,由于同一物体,在不同亮度的拍摄场景中同一光线角度具有不同的特征,比如户外逆光场景,预览画面主要表现为图像暗部较暗,亮部过曝,夜晚场景预览画面主要表现为像素主要集中在暗部,过曝区域较小。因此,为了使得确定的当前拍摄场景对应的像素比例阈值及亮度阈值更准确,本申请可以预先对拍摄场景进行一个大致划分,并且 对划分的场景分别进行像素比例阈值及亮度阈值的设置。It should be noted that, due to the same object, the same light angle has different features in different brightness shooting scenes, such as outdoor backlight scenes, and the preview picture mainly shows that the dark part of the image is dark, the bright part is overexposed, and the night scene preview picture mainly shows Pixels are mainly concentrated in the dark part, and the overexposed area is small. Therefore, in order to make the pixel ratio threshold and the brightness threshold corresponding to the determined current shooting scene more accurate, the present application may perform a rough division of the shooting scene in advance, and respectively set the pixel ratio threshold and the brightness threshold for the divided scenes.
比如,可根据拍摄场景的亮度大小,将拍摄场景分为三个,分别为高亮度场景、中亮度场景及低亮度场景。For example, the shooting scene can be divided into three according to the brightness of the shooting scene, which are a high-brightness scene, a medium-brightness scene, and a low-brightness scene.
其中,高亮度场景可以为室外等光线好的区域,中亮度场景可以为室内光线较好的区域,低亮度场景则可以为暗光或者夜晚光线差的区域等等,本申请对此不作具体限定。The high-brightness scene may be an area with good light such as outdoor, the medium-brightness scene may be a region with better indoor light, and the low-brightness scene may be a dark light or a region with poor night light, etc., which is not specifically limited in this application. .
在对不同场景进行划分之后,本实施例可进一步地对每个场景进行像素比例阈值及亮度阈值的设置。After dividing the different scenarios, the embodiment may further set the pixel ratio threshold and the brightness threshold for each scene.
其中,上述每个场景的像素比例阈值及亮度阈值可根据实际使用需求进行适应性设置,本申请对此不作具体限定。The pixel ratio threshold and the brightness threshold of each of the above scenarios may be adaptively set according to actual usage requirements, which is not specifically limited in this application.
进一步地,当对拍摄场景进行场景划分,并且对每个场景设置对应的像素比例阈值及亮度阈值之后,本实施例可将当前拍摄场景对应的亮度信息,分别与划分的每个场景进行匹配,以确定出当前拍摄场景对应的像素比例阈值及亮度阈值。Further, after the scene segmentation is performed on the shooting scene, and the corresponding pixel ratio threshold and the brightness threshold are set for each scene, the embodiment may match the brightness information corresponding to the current shooting scene with each of the divided scenes. The pixel ratio threshold and the brightness threshold corresponding to the current shooting scene are determined.
具体实现时,可先根据每个场景预设的亮度阈值与亮度范围的对应关系,确定与当前拍摄场景对应的目标亮度范围;然后根据预设的亮度范围与像素比例阈值及亮度阈值的对应关系,确定与目标亮度范围对应的像素比例阈值及亮度阈值。In a specific implementation, the target brightness range corresponding to the current shooting scene may be determined according to the corresponding relationship between the brightness threshold and the brightness range preset by each scene; and then the correspondence between the preset brightness range and the pixel ratio threshold and the brightness threshold is determined according to the preset brightness range. And determining a pixel ratio threshold and a brightness threshold corresponding to the target brightness range.
也就是说,本实施例是先根据获取的当前拍摄场景亮度信息,在不同场景的亮度范围中进行匹配,并根据匹配成功的亮度范围确定出当前拍摄场景所属的目标场景,然后根据所属的目标场景,获取对应的像素比例阈值及亮度阈值。从而,使得确定的像素比例阈值及亮度阈值更加准确。That is to say, in this embodiment, according to the acquired current shooting scene brightness information, matching is performed in the brightness range of different scenes, and the target scene to which the current shooting scene belongs is determined according to the brightness range of the matching success, and then according to the target target. The scene acquires a corresponding pixel ratio threshold and a brightness threshold. Thereby, the determined pixel ratio threshold and brightness threshold are made more accurate.
进一步的,确定了当前拍摄场景对应的像素比例阈值及亮度阈值后,即可根据当前拍摄场景对应的像素比例阈值、亮度阈值及当前预览画面的各颜色通道直方图,确定当前的光线角度。Further, after determining the pixel ratio threshold and the brightness threshold corresponding to the current shooting scene, the current ray angle may be determined according to the pixel ratio threshold, the brightness threshold, and the color channel histogram of the current preview scene.
需要说明的是,由于逆光场景时,各颜色通道的直方图中像素大多集中在高亮度或低亮度的位置,呈现“双峰”形式。It should be noted that, due to the backlight scene, the pixels in the histogram of each color channel are mostly concentrated in a position of high brightness or low brightness, and appear in a "double peak" form.
作为一个示例,光线的角度包括顺光和逆光两种。在具体实现时,像素比例阈值可以包括两个,分别为第一像素比例阈值和第二像素比例阈值。对应的,亮度阈值也包括两个,分别为第一亮度阈值和第二亮度阈值。As an example, the angle of the light includes both forward and backlight. In a specific implementation, the pixel ratio threshold may include two, which are a first pixel ratio threshold and a second pixel ratio threshold, respectively. Correspondingly, the brightness threshold also includes two, which are a first brightness threshold and a second brightness threshold, respectively.
并且,上述像素比例阈值与亮度阈值是相互对应设置的,即第一像素比例阈值与第一亮度阈值相对应,第二像素比例阈值与第二亮度阈值相对应。Moreover, the pixel ratio threshold and the brightness threshold are mutually corresponding, that is, the first pixel ratio threshold corresponds to the first brightness threshold, and the second pixel ratio threshold corresponds to the second brightness threshold.
从而,在获取到当前预览画面的直方图后,即可根据当前预览画面的直方图,判断当 前拍摄场景中光线角度是否为逆光。具体的,可以通过以下方式进行判断:Therefore, after the histogram of the current preview image is acquired, the histogram of the current preview image can be used to determine whether the light angle in the current shooting scene is backlit. Specifically, it can be judged by the following methods:
分别按照亮度由低至高及由高至低的方向,依次统计各颜色通道直方图中像素比例值的和;The sum of the pixel ratio values in the histograms of the respective color channels is sequentially counted according to the direction of the brightness from low to high and from high to low;
确定按照亮度由低至高像素比例值的和达到第一像素比例阈值时,各颜色通道分别对应的各第一亮度值;Determining, according to the brightness from the low to high pixel ratio value, reaching the first pixel ratio threshold, each color channel corresponding to each first brightness value;
确定按照亮度由高至低像素比例值的和达到第二像素比例阈值时,各颜色通道分别对应的各第二亮度值;Determining, according to the brightness from the sum of the high to low pixel ratio values, reaching the second pixel ratio threshold, each color channel corresponding to each second brightness value;
若任一颜色通道对应的第一亮度值小于第一亮度阈值,且第二亮度值大于第二亮度阈值,则确定拍摄场景中光线的角度为逆光。否则,确定为顺光。If the first brightness value corresponding to any color channel is smaller than the first brightness threshold, and the second brightness value is greater than the second brightness threshold, it is determined that the angle of the light in the shooting scene is back light. Otherwise, it is determined to be smooth.
由于光线的角度还可包括;侧光、侧逆光、顶光等,为了使确定的光线的角度更加准确,对于同一场景中,可根据需要设置像素比例阈值个数和大小,以及对应的亮度阈值,从而根据设置的像素比例阈值和亮度阈值,确定当前拍摄场景中光线的角度。The angle of the light may also include: side light, side back light, top light, etc., in order to make the angle of the determined light more accurate, for the same scene, the number and size of the pixel scale thresholds and the corresponding brightness threshold may be set as needed. , thereby determining the angle of the light in the current shooting scene according to the set pixel ratio threshold and the brightness threshold.
方式二Way two
根据当前拍摄时刻及位置,确定当前拍摄场景中的光线角度。Determine the angle of light in the current shooting scene based on the current shooting time and position.
具体的,由于逆光是由于被拍摄主体恰好处于光源和终端之间的状况,比如,被拍摄主体处于太阳和终端之间。因此,作为确定当前拍摄场景中光线的角度的一个示例,可根据当前拍摄时刻、位置等,确定当前拍摄场景中光线的角度。Specifically, since the backlight is due to a situation in which the subject is just between the light source and the terminal, for example, the subject is between the sun and the terminal. Therefore, as an example of determining the angle of the light in the current shooting scene, the angle of the light in the current shooting scene can be determined according to the current shooting time, position, and the like.
其中,位置包括终端所处的地理位置、终端的朝向(指终端的拍摄方向)等。比如,在北京中午12点,手机朝向南方进行拍摄,由于北京中午12点太阳处于南方,手机拍摄方向为南方,也就是被拍摄主体处于太阳与终端之间,即摄像头的预览画面中光线角度为逆光。The location includes the geographic location where the terminal is located, the orientation of the terminal (refer to the shooting direction of the terminal), and the like. For example, at 12 noon in Beijing, the mobile phone is shooting towards the south. Because the sun is at the south at 12 o'clock in Beijing, the direction of the mobile phone is south, that is, the subject is between the sun and the terminal, that is, the light angle of the preview image of the camera is Backlighting.
其中,终端所处的地理位置,可根据终端中的定位系统,如全球定位系统(Global Positioning System,简称GPS)等获取,拍摄时刻可从终端上的时钟获取,终端的朝向可根据终端中的指南针,或者终端上其他应用程序采集的当前终端的朝向获取。The location of the terminal can be obtained according to a positioning system in the terminal, such as a Global Positioning System (GPS). The shooting time can be obtained from the clock on the terminal, and the orientation of the terminal can be based on the terminal. The compass, or the orientation of the current terminal acquired by other applications on the terminal.
方式三Way three
根据当前预览画面中阴影的方向,确定当前拍摄场景中的光线角度。Determines the angle of the light in the current shooting scene based on the direction of the shadow in the current preview image.
实际使用时,由于预览画面中的阴影是由于光源照射到物体上,被物体遮挡形成的,由此根据确定预览画面中拍摄物体的阴影方向,即影子的方向,确定光线的角度。In actual use, since the shadow in the preview picture is formed by the object being occluded by the light source being irradiated onto the object, the angle of the light is determined according to the direction of the shadow of the object to be photographed in the preview image, that is, the direction of the shadow.
由于阴影一般位于预览画面的下半部分,且与拍摄物体的轮廓类似,在具体实现时,可根据从预览画面中提取的轮廓,以及轮廓在预览画面中的位置,确定预览画面中的阴影 以及阴影的方向。之后,根据阴影的方向,确定当前拍摄场景中光线的角度。Since the shadow is generally located in the lower half of the preview image and is similar to the contour of the captured object, in the specific implementation, the shadow in the preview image can be determined according to the contour extracted from the preview image and the position of the contour in the preview image. The direction of the shadow. Then, based on the direction of the shadow, the angle of the light in the current shooting scene is determined.
具体的,确定了光线的角度后,即可根据光线的角度,确定各摄像头当前的权重。Specifically, after determining the angle of the light, the current weight of each camera can be determined according to the angle of the light.
步骤102,根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。Step 102: Perform white balance processing on the currently acquired image according to the current weight of each camera.
可以理解的是,在本申请实施例中,可以设置在拍摄过程中,各摄像头均处于开启状态,从而各个摄像头均可以获取图像。在各个摄像头获取当前图像后,可以对各图像进行白平衡调节,并根据各摄像头当前的权重,对各处理后的图像进行合成生成当前的拍摄图像。It can be understood that, in the embodiment of the present application, each camera can be set to be in an open state during the shooting process, so that each camera can acquire an image. After each camera acquires the current image, white balance adjustment can be performed on each image, and each processed image is combined according to the current weight of each camera to generate a current captured image.
或者,为了避免资源的浪费,在一种较优的实现形式中,可以设置权重为0的摄像头为关闭状态,权重不为0的摄像头为启动状态。从而仅对权重不为0的摄像头当前获取的图像进行白平衡调节,并根据权重不为0的各摄像头当前的权重,对各处理后的图像进行合成生成当前的拍摄图像。Or, in order to avoid waste of resources, in a preferred implementation form, a camera with a weight of 0 may be set to be in a closed state, and a camera with a weight of not 0 may be in an activated state. Therefore, white balance adjustment is performed only on the image currently acquired by the camera whose weight is not 0, and each processed image is combined to generate a current captured image according to the current weight of each camera whose weight is not 0.
具体的,各摄像头获取当前图像后,即可根据各图像对应的各色温值,确定各摄像头对应的各目标白平衡增益值,从而根据各目标白平衡增益值,对各图像进行白平衡处理,最后根据各摄像头当前的权重,对处理后的各图像进行合成,即可生成当前的拍摄图像。Specifically, after acquiring the current image, each camera can determine each target white balance gain value corresponding to each camera according to each color temperature value corresponding to each image, thereby performing white balance processing on each image according to each target white balance gain value. Finally, according to the current weight of each camera, the processed images are combined to generate the current captured image.
可以理解的是,利用本申请实施例提供的白平衡处理方法,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。It can be understood that, by using the white balance processing method provided by the embodiment of the present application, the weight of each camera is adjusted according to the change of the shooting environment parameter, thereby ensuring that an image suitable for the current environmental parameter can be obtained, and the camera switching is avoided. The AWB hopping phenomenon has improved the user experience.
本申请实施例提供的白平衡处理方法,首先在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重,然后根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The white balance processing method provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
通过上述分析可知,在拍摄过程中,可以确定当前的拍摄环境参数对应的各摄像头当前的权重,从而根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。下面结合图2,对根据各摄像头当前的权重,对当前获取的图像进行白平衡处理的过程,进行具体说明。It can be seen from the above analysis that during the shooting process, the current weight of each camera corresponding to the current shooting environment parameter can be determined, so that the currently acquired image is white balanced according to the current weight of each camera. The process of performing white balance processing on the currently acquired image according to the current weight of each camera will be specifically described below with reference to FIG. 2 .
图2是本申请另一个实施例的白平衡处理方法的流程图。2 is a flow chart of a white balance processing method according to another embodiment of the present application.
如图2所示,该白平衡处理方法,应用于包括至少两种不同类型摄像头的终端中,该方法包括:As shown in FIG. 2, the white balance processing method is applied to a terminal including at least two different types of cameras, and the method includes:
步骤201,在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重。Step 201: During the shooting process, determine the current weight of each camera corresponding to the current shooting environment parameter.
其中,上述步骤201的具体实现过程及原理,可以参照上述实施例中步骤101的详细描述,此处不再赘述。For the specific implementation process and the principle of the foregoing step 201, refer to the detailed description of step 101 in the foregoing embodiment, and details are not described herein again.
步骤202,确定各摄像头当前获取的各图像对应的各色温值。Step 202: Determine color temperature values corresponding to respective images currently acquired by each camera.
具体的,可以通过多种方法确定各摄像头当前获取的各图像对应的各色温值。Specifically, the color temperature values corresponding to the respective images currently acquired by each camera may be determined by using various methods.
比如,可以根据各摄像头当前获取的图像中,各白色块对应的色温值,确定当前获取的图像对应的色温值;或者,可以根据各摄像头当前获取的图像中,目标拍摄对象所在的区域对应的色温值,确定当前采集的图像对应的色温值,等等。For example, the color temperature value corresponding to the currently acquired image may be determined according to the color temperature value corresponding to each white block in the image currently acquired by each camera; or, according to the image currently acquired by each camera, the area corresponding to the target shooting object The color temperature value determines the color temperature value corresponding to the currently acquired image, and so on.
步骤203,根据各色温值,确定各摄像头对应的各目标白平衡增益值。Step 203: Determine, according to each color temperature value, a target white balance gain value corresponding to each camera.
其中,目标白平衡增益值,用于将当前采集的图像调整至图像中的色彩可以真实重现。具体的,目标白平衡增益值,可以包括图像传感器获取的图像中R、G、B三个通道的目标白平衡增益值。The target white balance gain value is used to adjust the currently acquired image to the color in the image to be reproduced. Specifically, the target white balance gain value may include a target white balance gain value of three channels R, G, and B in the image acquired by the image sensor.
具体的,得到各摄像头当前获取的图像对应的各色温值后,即可判断出各图像的偏色方向,从而计算各目标白平衡增益值。Specifically, after obtaining the color temperature values corresponding to the images currently acquired by the cameras, the color cast directions of the respective images can be determined, thereby calculating the target white balance gain values.
具体实现时,可以根据得到的各色温值,采用计算、查表或者迭代等方法,计算各摄像头对应的各目标白平衡增益值。In the specific implementation, according to the obtained color temperature values, calculation, table lookup or iteration method may be used to calculate the target white balance gain values corresponding to the respective cameras.
作为一种可能的实现方式,当图像中颜色有足够的色彩变化时,所有像素点的颜色向量中的R,G,B三个分量的均值趋于平衡(1:1:1),采用加权灰度算法可得到较准确的目标白平衡增益值。As a possible implementation, when the color in the image has sufficient color change, the average of the three components R, G, and B in the color vector of all the pixels tends to be balanced (1:1:1), using weighting. The grayscale algorithm can obtain a more accurate target white balance gain value.
具体的,可以将每个摄像头当前获取的图像分成若干个子块,获取每个子块中所有像素点的颜色向量,每个像素点由一个(R,G,B)颜色向量表示,然后计算各子块中R,G,B三个通道的平均值和标准差,然后对每一个子块的标准差进行加权(舍弃相关性小的子块,保留相关性大的子块),以减少大块单一颜色的影响,使得图像颜色丰富多彩。进而计算通过标准差加权的R,G,B三个通道的平均值,最终计算得到R,G,B三个通道的增益系数,即得到该摄像头对应的目标白平衡增益值。Specifically, the image currently acquired by each camera may be divided into several sub-blocks, and the color vector of all the pixels in each sub-block is obtained, and each pixel is represented by a (R, G, B) color vector, and then each sub-calculation is calculated. The average and standard deviation of the three channels R, G, and B in the block, and then weight the standard deviation of each sub-block (abandon the sub-block with low correlation and retain the sub-block with high correlation) to reduce the large block. The effect of a single color makes the image colorful. Then, the average values of the three channels R, G, and B weighted by the standard deviation are calculated, and the gain coefficients of the three channels R, G, and B are finally calculated, that is, the target white balance gain value corresponding to the camera is obtained.
步骤204,利用各目标白平衡值对各图像进行白平衡处理,获取处理后的各图像。Step 204: Perform white balance processing on each image by using each target white balance value, and acquire each processed image.
具体的,确定各摄像头对应的目标白平衡增益值后,即可根据计算得到的各目标白平衡增益值,计算各摄像头当前获取的图像调整后各像素的R值和B值数据,从而实现对各图像的颜色修正。Specifically, after determining the target white balance gain value corresponding to each camera, the R value and the B value data of each pixel after the image adjustment currently obtained by each camera are calculated according to the calculated target white balance gain values, thereby realizing Color correction for each image.
需要说明的是,由于人眼对于频谱中属于绿光波长的光(480nm-600nm)敏感度最高,而拜耳(Bayer)阵列中采集的绿色像素点数目最多,所以目前的相机通常都采用将绿色分 量的增益值固定,然后分别调整红色分量和蓝色分量的增益值,实现对红色分量和蓝色分量的调整。It should be noted that since the human eye has the highest sensitivity to light (480 nm-600 nm) belonging to the green wavelength in the spectrum, and the Bayer array has the largest number of green pixels collected, the current camera usually adopts green. The gain value of the component is fixed, and then the gain values of the red component and the blue component are respectively adjusted to achieve adjustment of the red component and the blue component.
步骤205,根据各摄像头当前的权重,对处理后的各图像进行合成生成当前的拍摄图像。Step 205: Synthesize each processed image to generate a current captured image according to the current weight of each camera.
可以理解的是,利用各目标白平衡值对各摄像头当前获取的各图像进行处理后,处理后的各图像的色彩饱和度可能不同,那么,在本申请实施例中,可以根据处理后的各图像的色彩饱和度的不同,采用不同的合成模式,对处理后的各图像进行合成生成当前的拍摄图像。It can be understood that, after each image currently acquired by each camera is processed by using the target white balance value, the color saturation of each image after processing may be different, and then, in the embodiment of the present application, according to the processed Different color saturation of the image, using different synthesis modes, the processed images are combined to generate the current captured image.
即,可以根据处理后的各图像的色彩饱和度,确定目标合成模式,从而基于目标合成模式,根据各摄像头当前的权重,对处理后的各图像进行合成生成当前的拍摄图像。That is, the target composition mode can be determined based on the color saturation of each of the processed images, and the processed images can be combined to generate the current captured image based on the current weight of each camera based on the target composition mode.
其中,目标合成模式,用来指示对处理后的各图像进行合成生成当前的拍摄图像时的具体方式。The target synthesis mode is used to indicate a specific manner when the processed images are combined to generate a current captured image.
具体的,可以预先设置色彩饱和度阈值,从而根据处理后的各图像的色彩饱和度与预设的色彩饱和度阈值的关系,确定对应的目标合成模式,以基于目标合成模式,根据各摄像头当前的权重,对处理后的各图像进行合成。Specifically, the color saturation threshold may be preset, so that the corresponding target synthesis mode is determined according to the relationship between the processed color saturation of each image and the preset color saturation threshold, based on the target synthesis mode, according to each camera current The weight of each of the processed images is combined.
比如,可以预设色彩饱和度阈值为无限接近0的数值,以将处理后的各图像划分为灰度图像和彩色图像,在确定处理后的各图像的色彩饱和度小于阈值时,即各图像为灰度图像时,可以根据各摄像头当前的权重,采用灰度加权平均法,对处理后的各图像进行合成以生成当前的拍摄图像。For example, the color saturation threshold may be preset to a value that is infinitely close to 0, so that each processed image is divided into a gray image and a color image, and when the color saturation of each image after the processing is determined to be less than a threshold, that is, each image In the case of a grayscale image, the processed images may be combined to generate a current captured image by using a grayscale weighted average method according to the current weight of each camera.
具体的,假设对处理后的M个大小为I*J的图像N 1、N 2、…N M进行合成,合成后的图像为F,则可以通过以下公式,进行图像合成。 Specifically, assuming that the M is the size of the processed image I * J N 1, N 2, ... N M synthesized, the synthesized image is F, it is possible, the image synthesized by the following equation.
F(i,j)=w 1(i,j)N 1(i,j)+w 2(i,j)N 2(i,j)+…+w M(i,j)N M(i,j) F(i,j)=w 1 (i,j)N 1 (i,j)+w 2 (i,j)N 2 (i,j)+...+w M (i,j)N M (i , j)
其中,i为各图像中像素的行位置,i=1,2,3,…,I;Where i is the row position of the pixels in each image, i=1, 2, 3, ..., I;
j为各图像中像素的列位置,j=1,2,3,…,J;j is the column position of the pixel in each image, j=1, 2, 3, ..., J;
w x(i,j),x=1,2,3,…M为各图像对应的摄像头当前的权重,且
Figure PCTCN2018094971-appb-000001
w x (i, j), x=1, 2, 3, ... M is the current weight of the camera corresponding to each image, and
Figure PCTCN2018094971-appb-000001
N x(i,j),x=1,2,3,…M为第x幅图像第(i,j)点的像素灰度值。 N x (i, j), x = 1, 2, 3, ... M is the pixel gray value of the (i, j)th point of the xth image.
相应的,在确定处理后的各图像的色彩饱和度大于阈值时,即各图像为彩色图像时,可以按照三基色模型,将各个图像看作三幅单色图像(红、绿、蓝)的叠加,分别根据各摄像头当前的权值,对各色图像进行合成,最终得到合成后的三幅红、绿、蓝单色图像,再由三幅单色图像叠加,以生成当前的拍摄图像。Correspondingly, when it is determined that the color saturation of each processed image is greater than a threshold, that is, when each image is a color image, each image may be regarded as three monochrome images (red, green, blue) according to the three primary color models. Superimposed, respectively, according to the current weight of each camera, the color images are synthesized, and finally the three red, green and blue monochrome images are synthesized, and then superimposed by three monochrome images to generate the current captured image.
具体的,假设对处理后的M个大小为I*J的图像N 1、N 2、…N M进行合成,合成后的图像为F,则可以通过以下公式,进行图像合成。 Specifically, assuming that the M is the size of the processed image I * J N 1, N 2, ... N M synthesized, the synthesized image is F, it is possible, the image synthesized by the following equation.
F R(i,j)=w 1(i,j)N 1R(i,j)+w 2(i,j)N 2R(i,j)+…+w M(i,j)N MR(i,j); F R (i,j)=w 1 (i,j)N 1R (i,j)+w 2 (i,j)N 2R (i,j)+...+w M (i,j)N MR ( i,j);
F G(i,j)=w 1(i,j)N 1G(i,j)+w 2(i,j)N 2G(i,j)+…+w M(i,j)N MG(i,j); F G (i,j)=w 1 (i,j)N 1G (i,j)+w 2 (i,j)N 2G (i,j)+...+w M (i,j)N MG ( i,j);
F B(i,j)=w 1(i,j)N 1B(i,j)+w 2(i,j)N 2B(i,j)+…+w M(i,j)N MB(i,j)。 F B (i,j)=w 1 (i,j)N 1B (i,j)+w 2 (i,j)N 2B (i,j)+...+w M (i,j)N MB ( i, j).
其中,R、G、B分别表示三基色红、绿、蓝;Wherein, R, G, and B respectively represent three primary colors of red, green, and blue;
i为各图像中像素的行位置,i=1,2,3,…,I;i is the row position of the pixel in each image, i=1, 2, 3, ..., I;
j为各图像中像素的列位置,j=1,2,3,…,J;j is the column position of the pixel in each image, j=1, 2, 3, ..., J;
F R(i,j)、F G(i,j)、F B(i,j)分别为合成后的图像的第(i,j)点的R、G、B通道的值; F R (i, j), F G (i, j), F B (i, j) are the values of the R, G, and B channels of the (i, j)th point of the synthesized image, respectively;
w x(i,j),x=1,2,3,…M为各图像对应的摄像头当前的权重,且
Figure PCTCN2018094971-appb-000002
w x (i, j), x=1, 2, 3, ... M is the current weight of the camera corresponding to each image, and
Figure PCTCN2018094971-appb-000002
N xR(i,j),x=1,2,3,…M为第x幅图像第(i,j)点的R通道的值; N xR (i, j), x = 1, 2, 3, ... M is the value of the R channel of the (i, j)th point of the xth image;
N xG(i,j),x=1,2,3,…M为第x幅图像第(i,j)点的G通道的值; N xG (i, j), x = 1, 2, 3, ... M is the value of the G channel of the (i, j)th point of the xth image;
N xB(i,j),x=1,2,3,…M为第x幅图像第(i,j)点的B通道的值。 N xB (i, j), x = 1, 2, 3, ... M is the value of the B channel of the (i, j)th point of the xth image.
需要说明的是,在处理后的各图像的色彩饱和度大于阈值,即各图像为彩色图像时,也可以先将各图像转换为灰度图像,然后根据各摄像头当前的权重,采用灰度加权平均法,对处理后的各图像进行合成以生成当前的拍摄图像。It should be noted that, when the color saturation of each image after processing is greater than a threshold, that is, when each image is a color image, each image may be first converted into a grayscale image, and then gray weighted according to the current weight of each camera. The averaging method combines the processed images to generate a current captured image.
本申请实施例提供的白平衡处理方法,在拍摄过程中,首先确定与当前的拍摄环境参数对应的各摄像头当前的权重,然后确定各摄像头当前获取的各图像对应的各色温值,再根据各色温值,确定各摄像头对应的各目标白平衡增益值,再利用各目标白平衡值对各图像进行白平衡处理,获取处理后的各图像,最后根据各摄像头当前的权重,对处理后的各图像进行合成生成当前的拍摄图像。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The white balance processing method provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter, and then determines the color temperature values corresponding to the respective images currently acquired by each camera, and then according to each The color temperature value determines the target white balance gain value corresponding to each camera, and then performs white balance processing on each image by using each target white balance value, acquires each processed image, and finally processes each processed image according to the current weight of each camera. The image is synthesized to generate the current captured image. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
图3是本申请一个实施例的白平衡处理装置的结构图。Fig. 3 is a structural diagram of a white balance processing apparatus according to an embodiment of the present application.
如图3所示,该白平衡处理装置,应用于包括至少两种不同类型摄像头的终端中,该装置包括:As shown in FIG. 3, the white balance processing apparatus is applied to a terminal including at least two different types of cameras, and the apparatus includes:
第一确定模块31,由于在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重;The first determining module 31 determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process;
处理模块32,由于根据所述各摄像头当前的权重,对当前获取的图像进行白平衡处理。The processing module 32 performs white balance processing on the currently acquired image according to the current weight of each camera.
其中,本实施例提供的白平衡处理装置,可以执行本申请实施例提供的白平衡处理方法。具体的,该白平衡处理装置,可以被配置在任意具有至少两种不同类型摄像头的终端中。其中,终端的类型很多,可以根据应用需要进行选择,例如:手机、电脑、相机等。The white balance processing apparatus provided in this embodiment can perform the white balance processing method provided by the embodiment of the present application. Specifically, the white balance processing device can be configured in any terminal having at least two different types of cameras. Among them, there are many types of terminals, which can be selected according to application needs, such as mobile phones, computers, cameras, and the like.
在本实施例一种可能的实现形式中,上述第一确定模块31,具体用于:In a possible implementation form of the embodiment, the first determining module 31 is specifically configured to:
根据当前的变焦倍数、物距和/或光源条件,确定各摄像头当前的权重。The current weight of each camera is determined based on the current zoom factor, object distance, and/or light source conditions.
在本实施例另一种可能的实现形式中,上述处理模块32,包括:In another possible implementation manner of the embodiment, the processing module 32 includes:
第一确定单元,用于确定所述各摄像头当前获取的各图像对应的各色温值;a first determining unit, configured to determine color temperature values corresponding to each image currently acquired by each camera;
第二确定单元,用于根据所述各色温值,确定所述各摄像头对应的各目标白平衡增益值;a second determining unit, configured to determine, according to the color temperature values, respective target white balance gain values corresponding to the cameras;
获取单元,用于利用所述各目标白平衡值对所述各图像进行白平衡处理,获取处理后的各图像;An acquiring unit, configured to perform white balance processing on each image by using each target white balance value, and acquire each processed image;
合成单元,用于根据所述各摄像头当前的权重,对所述处理后的各图像进行合成生成当前的拍摄图像。The synthesizing unit is configured to synthesize the processed images to generate a current captured image according to the current weight of each camera.
在本实施例另一种可能的实现形式中,上述第一确定单元,具体用于:In another possible implementation manner of the embodiment, the foregoing first determining unit is specifically configured to:
根据所述各摄像头当前获取的各图像中白色块对应的色温值,确定所述各摄像头当前获取的各图像对应的色温值;Determining, according to a color temperature value corresponding to the white block in each image currently acquired by each camera, a color temperature value corresponding to each image currently acquired by each camera;
或者,or,
根据所述各摄像头当前获取的图像中,目标拍摄对象所在的区域对应的色温值,确定所述各摄像头当前采集的图像对应的色温值。And determining a color temperature value corresponding to the image currently acquired by each camera according to a color temperature value corresponding to an area where the target object is located in the image currently acquired by each camera.
在本实施例另一种可能的实现形式中,上述处理模块32,还包括:In another possible implementation manner of the embodiment, the processing module 32 further includes:
第三确定单元,用于根据所述处理后的各图像的色彩饱和度,确定目标合成模式;a third determining unit, configured to determine a target synthesis mode according to the color saturation of each processed image;
相应的,上述合成单元,具体用于:Correspondingly, the above synthesizing unit is specifically used for:
基于所述目标合成模式,根据所述各摄像头当前的权重,对所述处理后的各图像进行合成生成当前的拍摄图像。Based on the target composition mode, the processed images are combined to generate a current captured image according to the current weight of each camera.
在本实施例另一种可能的实现形式中,上述第三确定单元,具体用于:In another possible implementation manner of the embodiment, the foregoing third determining unit is specifically configured to:
在确定所述处理后的各图像的色彩饱和度小于阈值时,根据所述各摄像头当前的权重,采用灰度加权平均法,对所述处理后的各图像进行合成生成当前的拍摄图像;When it is determined that the color saturation of each of the processed images is less than a threshold, the processed images are combined to generate a current captured image by using a gray weighted average method according to the current weight of each camera;
在确定所述处理后的各图像的色彩饱和度大于阈值时,根据所述各摄像头当前的权重,按照三基色模型,分别对各单色图像进行合成;将合成后的三幅单色图像叠加生成当前的拍摄图像。When it is determined that the color saturation of each of the processed images is greater than a threshold, respectively, according to the current weight of each camera, each monochrome image is synthesized according to the three primary color models; and the combined three monochrome images are superimposed Generate the current captured image.
需要说明的是,前述实施例中对白平衡处理方法实施例的解释说明也适用于该实施例的白平衡处理装置,此处不再赘述。It should be noted that the explanation of the embodiment of the white balance processing method in the foregoing embodiment is also applicable to the white balance processing apparatus of the embodiment, and details are not described herein again.
本申请实施例提供的白平衡处理装置,首先在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重,然后根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The white balance processing device provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
图4是本申请另一个实施例的白平衡处理装置的结构图。Fig. 4 is a structural diagram of a white balance processing apparatus according to another embodiment of the present application.
如图4所示,在图3所示的基础上,该白平衡处理装置,还包括:As shown in FIG. 4, the white balance processing apparatus further includes:
第二确定模块41,用于根据获取的变焦指令或图像调节指令,确定所述当前的变焦倍数;a second determining module 41, configured to determine the current zoom factor according to the acquired zoom instruction or image adjustment instruction;
和/或,用于根据距离传感器的输出值或者当前获取的图像中包含的深度信息,确定当前的物距;And/or, configured to determine a current object distance according to an output value of the distance sensor or depth information included in the currently acquired image;
和/或,用于根据各摄像头的光圈大小、快门时间及感光度,确定当前的光源条件。And/or, for determining the current light source condition according to the aperture size, shutter time, and sensitivity of each camera.
在本实施例一种可能的实现形式中,所述光源条件为光线的角度;In a possible implementation form of the embodiment, the light source condition is an angle of the light;
相应的,上述第二确定模块41,还用于:Correspondingly, the foregoing second determining module 41 is further configured to:
根据当前采集的画面对应的各颜色通道直方图,确定当前的光线角度;Determining the current ray angle according to each color channel histogram corresponding to the currently acquired picture;
或者,or,
根据当前拍摄时刻及位置,确定当前拍摄场景中的光线角度;Determining the angle of light in the current shooting scene according to the current shooting time and position;
或者,or,
根据当前预览画面中阴影的方向,确定当前拍摄场景中的光线角度。Determines the angle of the light in the current shooting scene based on the direction of the shadow in the current preview image.
需要说明的是,前述实施例中对白平衡处理方法实施例的解释说明也适用于该实施例的白平衡处理装置,此处不再赘述。It should be noted that the explanation of the embodiment of the white balance processing method in the foregoing embodiment is also applicable to the white balance processing apparatus of the embodiment, and details are not described herein again.
本申请实施例提供的白平衡处理装置,首先在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重,然后根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The white balance processing device provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
本申请再一方面实施例还提出一种终端。A further embodiment of the present application further provides a terminal.
图5是本申请一个实施例提供的终端的结构图。FIG. 5 is a structural diagram of a terminal according to an embodiment of the present application.
其中,终端的类型很多,可以根据应用需要进行选择,例如:手机、电脑、相机等。图5以终端为手机进行示意。Among them, there are many types of terminals, which can be selected according to application needs, such as mobile phones, computers, cameras, and the like. Figure 5 shows the terminal as a mobile phone.
如图5所示,该终端包括:壳体501、处理器502、存储器503、电路板504、电源电路505和至少两种不同类型的摄像头,图中以包括两个摄像头506和507进行示意。As shown in FIG. 5, the terminal includes a housing 501, a processor 502, a memory 503, a circuit board 504, a power supply circuit 505, and at least two different types of cameras, which are illustrated by including two cameras 506 and 507.
其中,电路板504安置在壳体501围成的空间内部,处理器502和存储器503设置在电路板504上;电源电路505,用于为终端的各个电路或器件供电;存储器503用于存储可执行程序代码;处理器502通过读取存储器503中存储的可执行程序代码,来运行与可执行程序代码对应的程序,以用于执行如前述实施例中的白平衡处理方法,该白平衡处理方法包括:Wherein, the circuit board 504 is disposed inside the space enclosed by the housing 501, the processor 502 and the memory 503 are disposed on the circuit board 504; the power supply circuit 505 is used to supply power to each circuit or device of the terminal; and the memory 503 is used for storing The program code is executed by the processor 502 by executing the executable program code stored in the memory 503 to execute a program corresponding to the executable program code for performing the white balance processing method as in the foregoing embodiment, the white balance processing Methods include:
在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重;During the shooting process, determining the current weight of each camera corresponding to the current shooting environment parameter;
根据所述各摄像头当前的权重,对当前获取的图像进行白平衡处理。The currently acquired image is subjected to white balance processing according to the current weight of each camera.
需要说明的是,前述对白平衡处理方法实施例的解释说明也适用于该实施例的终端,其实现原理类似,此处不再赘述。It should be noted that the foregoing description of the embodiment of the white balance processing method is also applicable to the terminal of the embodiment, and the implementation principle is similar, and details are not described herein again.
本申请实施例提供的终端,首先在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重,然后根据各摄像头当前的权重,对当前获取的图像进行白平衡处理。由此,通过根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The terminal provided by the embodiment of the present application first determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process, and then performs white balance processing on the currently acquired image according to the current weight of each camera. Therefore, by adjusting the weight of each camera according to the change of the shooting environment parameter, it is ensured that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
本申请再一方面实施例提出了一种计算机可读存储介质,其上存储有计算机程序,当该程序被处理器执行时实现如前述实施例中的白平衡处理方法。Still another embodiment of the present application proposes a computer readable storage medium having stored thereon a computer program that, when executed by the processor, implements a white balance processing method as in the foregoing embodiments.
本申请实施例提供的计算机可读存储介质,可以设置在任意包括至少两种不同类型摄像头,需要进行白平衡调节的终端中,在进行白平衡调节时,通过执行其上存储的白平衡处理方法,可以实现根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体验。The computer readable storage medium provided by the embodiment of the present application may be disposed in any terminal that includes at least two different types of cameras and needs white balance adjustment, and performs white balance processing method stored thereon when performing white balance adjustment. The weight of each camera can be adjusted according to the change of the shooting environment parameters, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
本申请再一方面实施例提出了一种计算机程序产品,当所述计算机程序产品中的指令由处理器执行时,执行如前述实施例中的白平衡处理方法。A further aspect of the present application is directed to a computer program product that, when executed by a processor, executes a white balance processing method as in the previous embodiments.
本申请实施例提供的计算机程序产品,可以设置在任意包括至少两种不同类型摄像头,需要进行白平衡调节的终端中,在进行白平衡调节时,通过执行对应白平衡处理方法的程序,可以实现根据拍摄环境参数变化,调整各摄像头的权重,从而既保证了可以获得适合当前环境参数的图像,又避免了由于摄像头切换,带来的AWB跳变现象,改善了用户体 验。The computer program product provided by the embodiment of the present application can be set in any terminal that includes at least two different types of cameras, and needs to perform white balance adjustment. When performing white balance adjustment, the program corresponding to the white balance processing method can be implemented. According to the change of the shooting environment parameters, the weight of each camera is adjusted, thereby ensuring that an image suitable for the current environmental parameters can be obtained, and the AWB jump phenomenon caused by the camera switching is avoided, and the user experience is improved.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer readable medium, Used in conjunction with, or in conjunction with, an instruction execution system, apparatus, or device (eg, a computer-based system, a system including a processor, or other system that can fetch instructions and execute instructions from an instruction execution system, apparatus, or device) Or use with equipment. For the purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM). In addition, the computer readable medium may even be a paper or other suitable medium on which the program can be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, other suitable The method is processed to obtain the program electronically and then stored in computer memory.
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that portions of the application can be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
需要说明的是,在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示 意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。It should be noted that in the description of the specification, the descriptions of the terms "one embodiment", "some embodiments", "example", "specific examples", or "some examples" and the like are meant to be combined with the embodiments or The specific features, structures, materials, or characteristics described in the examples are included in at least one embodiment or example of the application. In the present specification, the illustrative expressions of the above terms are not necessarily directed to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, various embodiments or examples described in the specification and features of various embodiments or examples may be combined and combined without departing from the scope of the invention.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the application. In the present specification, the schematic representation of the above terms is not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, various embodiments or examples described in the specification and features of various embodiments or examples may be combined and combined without departing from the scope of the invention.
尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。While the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are illustrative and are not to be construed as limiting the scope of the present application. The embodiments are subject to variations, modifications, substitutions and variations.

Claims (19)

  1. 一种白平衡处理方法,应用于包含至少两种不同类型摄像头的终端中,其特征在于,包括:A white balance processing method is applied to a terminal including at least two different types of cameras, and includes:
    在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重;During the shooting process, determining the current weight of each camera corresponding to the current shooting environment parameter;
    根据所述各摄像头当前的权重,对当前获取的图像进行白平衡处理。The currently acquired image is subjected to white balance processing according to the current weight of each camera.
  2. 如权利要求1所述的方法,其特征在于,所述确定与当前的拍摄环境参数对应的各摄像头当前的权重,包括:The method according to claim 1, wherein the determining the current weight of each camera corresponding to the current shooting environment parameter comprises:
    根据当前的变焦倍数、物距和/或光源条件,确定各摄像头当前的权重。The current weight of each camera is determined based on the current zoom factor, object distance, and/or light source conditions.
  3. 如权利要求1所述的方法,其特征在于,所述确定与当前的拍摄环境参数对应的各摄像头当前的白平衡调节权重之前,还包括:The method of claim 1, wherein before determining the current white balance adjustment weight of each camera corresponding to the current shooting environment parameter, the method further includes:
    根据获取的变焦指令或图像调节指令,确定所述当前的变焦倍数;Determining the current zoom factor according to the obtained zoom instruction or image adjustment instruction;
    和/或,根据距离传感器的输出值或者当前获取的图像中包含的深度信息,确定当前的物距;And/or determining the current object distance according to the output value of the distance sensor or the depth information included in the currently acquired image;
    和/或,根据各摄像头的光圈大小、快门时间及感光度,确定当前的光源条件。And/or, the current light source condition is determined according to the aperture size, shutter time, and sensitivity of each camera.
  4. 如权利要求2或3所述的方法,其特征在于,所述光源条件为光线的角度;The method according to claim 2 or 3, wherein said light source condition is an angle of light;
    所述确定与当前的拍摄环境参数对应的各摄像头当前的白平衡调节权重之前,还包括:Before determining the current white balance adjustment weight of each camera corresponding to the current shooting environment parameter, the method further includes:
    根据当前采集的画面对应的各颜色通道直方图,确定当前的光线角度;Determining the current ray angle according to each color channel histogram corresponding to the currently acquired picture;
    或者,or,
    根据当前拍摄时刻及位置,确定当前拍摄场景中的光线角度;Determining the angle of light in the current shooting scene according to the current shooting time and position;
    或者,or,
    根据当前预览画面中阴影的方向,确定当前拍摄场景中的光线角度。Determines the angle of the light in the current shooting scene based on the direction of the shadow in the current preview image.
  5. 如权利要求1-4任一所述的方法,其特征在于,所述根据所述各摄像头当前的权重,对当前获取的图像进行白平衡处理,包括:The method according to any one of claims 1-4, wherein the performing white balance processing on the currently acquired image according to the current weight of each camera comprises:
    确定所述各摄像头当前获取的各图像对应的各色温值;Determining, for each color temperature value corresponding to each image currently acquired by each camera;
    根据所述各色温值,确定所述各摄像头对应的各目标白平衡增益值;Determining, according to the color temperature values, respective target white balance gain values corresponding to the respective cameras;
    利用所述各目标白平衡值对所述各图像进行白平衡处理,获取处理后的各图像;Performing white balance processing on each of the images by using the target white balance values, and acquiring the processed images;
    根据所述各摄像头当前的权重,对所述处理后的各图像进行合成生成当前的拍摄图像。The processed images are combined to generate a current captured image based on the current weight of each camera.
  6. 如权利要求5所述的方法,其特征在于,所述确定所述各摄像头当前获取的各图像对应的各色温值,包括:The method according to claim 5, wherein the determining the color temperature values corresponding to the images currently acquired by the cameras comprises:
    根据所述各摄像头当前获取的各图像中白色块对应的色温值,确定所述各摄像头当前获取的各图像对应的色温值;Determining, according to a color temperature value corresponding to the white block in each image currently acquired by each camera, a color temperature value corresponding to each image currently acquired by each camera;
    或者,or,
    根据所述各摄像头当前获取的图像中,目标拍摄对象所在的区域对应的色温值,确定所述各摄像头当前采集的图像对应的色温值。And determining a color temperature value corresponding to the image currently acquired by each camera according to a color temperature value corresponding to an area where the target object is located in the image currently acquired by each camera.
  7. 如权利要求5或6所述的方法,其特征在于,所述根据所述各摄像头当前的权重,对所述处理后的各图像进行合成生成当前的拍摄图像之前,还包括:The method according to claim 5 or claim 6, wherein before the synthesizing the processed images to generate the current captured image according to the current weight of each camera, the method further includes:
    根据所述处理后的各图像的色彩饱和度,确定目标合成模式;Determining a target synthesis mode according to color saturation of each of the processed images;
    所述根据所述各摄像头当前的权重,对所述处理后的各图像进行合成生成当前的拍摄图像,包括:And synthesizing the processed images to generate a current captured image according to the current weight of each camera, including:
    基于所述目标合成模式,根据所述各摄像头当前的权重,对所述处理后的各图像进行合成生成当前的拍摄图像。Based on the target composition mode, the processed images are combined to generate a current captured image according to the current weight of each camera.
  8. 如权利要求7所述的方法,其特征在于,所述根据所述处理后的各图像的色彩饱和度,确定目标合成模式,包括:The method according to claim 7, wherein the determining the target synthesis mode according to the color saturation of the processed images comprises:
    在确定所述处理后的各图像的色彩饱和度小于阈值时,根据所述各摄像头当前的权重,采用灰度加权平均法,对所述处理后的各图像进行合成生成当前的拍摄图像;When it is determined that the color saturation of each of the processed images is less than a threshold, the processed images are combined to generate a current captured image by using a gray weighted average method according to the current weight of each camera;
    在确定所述处理后的各图像的色彩饱和度大于阈值时,根据所述各摄像头当前的权重,按照三基色模型,分别对各单色图像进行合成;将合成后的三幅单色图像叠加生成当前的拍摄图像。When it is determined that the color saturation of each of the processed images is greater than a threshold, respectively, according to the current weight of each camera, each monochrome image is synthesized according to the three primary color models; and the combined three monochrome images are superimposed Generate the current captured image.
  9. 一种白平衡处理装置,应用于包含至少两种不同类型摄像头的终端中,其特征在于,包括:A white balance processing device is applied to a terminal including at least two different types of cameras, and includes:
    第一确定模块,由于在拍摄过程中,确定与当前的拍摄环境参数对应的各摄像头当前的权重;The first determining module determines the current weight of each camera corresponding to the current shooting environment parameter during the shooting process;
    处理模块,由于根据所述各摄像头当前的权重,对当前获取的图像进行白平衡处理。The processing module performs white balance processing on the currently acquired image according to the current weight of each camera.
  10. 如权利要求9所述的装置,其特征在于,所述第一确定模块,具体用于:The device according to claim 9, wherein the first determining module is specifically configured to:
    根据当前的变焦倍数、物距和/或光源条件,确定各摄像头当前的权重。The current weight of each camera is determined based on the current zoom factor, object distance, and/or light source conditions.
  11. 如权利要求9所述的装置,其特征在于,还包括:The device of claim 9 further comprising:
    第二确定模块,用于根据获取的变焦指令或图像调节指令,确定所述当前的变焦倍数;a second determining module, configured to determine the current zoom factor according to the acquired zoom instruction or image adjustment instruction;
    和/或,用于根据距离传感器的输出值或者当前获取的图像中包含的深度信息,确定当前的物距;And/or, configured to determine a current object distance according to an output value of the distance sensor or depth information included in the currently acquired image;
    和/或,用于根据各摄像头的光圈大小、快门时间及感光度,确定当前的光源条件。And/or, for determining the current light source condition according to the aperture size, shutter time, and sensitivity of each camera.
  12. 如权利要求10或11所述的装置,其特征在于,所述光源条件为光线的角度;The device according to claim 10 or 11, wherein said light source condition is an angle of light;
    所述第二确定模块,还用于:The second determining module is further configured to:
    根据当前采集的画面对应的各颜色通道直方图,确定当前的光线角度;Determining the current ray angle according to each color channel histogram corresponding to the currently acquired picture;
    或者,or,
    根据当前拍摄时刻及位置,确定当前拍摄场景中的光线角度;Determining the angle of light in the current shooting scene according to the current shooting time and position;
    或者,or,
    根据当前预览画面中阴影的方向,确定当前拍摄场景中的光线角度。Determines the angle of the light in the current shooting scene based on the direction of the shadow in the current preview image.
  13. 如权利要求9-12任一所述的装置,其特征在于,所述处理模块,包括:The device of any of claims 9-12, wherein the processing module comprises:
    第一确定单元,用于确定所述各摄像头当前获取的各图像对应的各色温值;a first determining unit, configured to determine color temperature values corresponding to each image currently acquired by each camera;
    第二确定单元,用于根据所述各色温值,确定所述各摄像头对应的各目标白平衡增益值;a second determining unit, configured to determine, according to the color temperature values, respective target white balance gain values corresponding to the cameras;
    获取单元,用于利用所述各目标白平衡值对所述各图像进行白平衡处理,获取处理后的各图像;An acquiring unit, configured to perform white balance processing on each image by using each target white balance value, and acquire each processed image;
    合成单元,用于根据所述各摄像头当前的权重,对所述处理后的各图像进行合成生成当前的拍摄图像。The synthesizing unit is configured to synthesize the processed images to generate a current captured image according to the current weight of each camera.
  14. 如权利要求13所述的装置,其特征在于,所述第一确定单元,具体用于:The device according to claim 13, wherein the first determining unit is specifically configured to:
    根据所述各摄像头当前获取的各图像中白色块对应的色温值,确定所述各摄像头当前获取的各图像对应的色温值;Determining, according to a color temperature value corresponding to the white block in each image currently acquired by each camera, a color temperature value corresponding to each image currently acquired by each camera;
    或者,or,
    根据所述各摄像头当前获取的图像中,目标拍摄对象所在的区域对应的色温值,确定所述各摄像头当前采集的图像对应的色温值。And determining a color temperature value corresponding to the image currently acquired by each camera according to a color temperature value corresponding to an area where the target object is located in the image currently acquired by each camera.
  15. 如权利要求13或14所述的装置,其特征在于,所述处理模块,还包括:The device according to claim 13 or 14, wherein the processing module further comprises:
    第三确定单元,用于根据所述处理后的各图像的色彩饱和度,确定目标合成模式;a third determining unit, configured to determine a target synthesis mode according to the color saturation of each processed image;
    所述合成单元,具体用于:The synthesizing unit is specifically configured to:
    基于所述目标合成模式,根据所述各摄像头当前的权重,对所述处理后的各图像进行合成生成当前的拍摄图像。Based on the target composition mode, the processed images are combined to generate a current captured image according to the current weight of each camera.
  16. 如权利要求15所述的装置,其特征在于,所述第三确定单元,具体用于:The device according to claim 15, wherein the third determining unit is specifically configured to:
    在确定所述处理后的各图像的色彩饱和度小于阈值时,根据所述各摄像头当前的权重,采用灰度加权平均法,对所述处理后的各图像进行合成生成当前的拍摄图像;When it is determined that the color saturation of each of the processed images is less than a threshold, the processed images are combined to generate a current captured image by using a gray weighted average method according to the current weight of each camera;
    在确定所述处理后的各图像的色彩饱和度大于阈值时,根据所述各摄像头当前的权重,按照三基色模型,分别对各单色图像进行合成;将合成后的三幅单色图像叠加生成当前的拍摄图像。When it is determined that the color saturation of each of the processed images is greater than a threshold, respectively, according to the current weight of each camera, each monochrome image is synthesized according to the three primary color models; and the combined three monochrome images are superimposed Generate the current captured image.
  17. 一种终端,其特征在于,包括:壳体、处理器、存储器、电路板、电源电路和至少两种不同类型的摄像头,其中,所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上;所述电源电路,用于为所述终端的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过读取所述存储器中存储的可执行程序代码,来运行与所述可执行程序代码对应的程序,以用于执行如权利要求1-8中任一所述的白平衡处理方法。A terminal, comprising: a housing, a processor, a memory, a circuit board, a power supply circuit, and at least two different types of cameras, wherein the circuit board is disposed inside a space enclosed by the housing, The processor and the memory are disposed on the circuit board; the power circuit is configured to supply power to each circuit or device of the terminal; the memory is configured to store executable program code; The executable program code stored in the memory is read to execute a program corresponding to the executable program code for performing the white balance processing method according to any one of claims 1-8.
  18. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-8中任一所述的白平衡处理方法。A computer readable storage medium having stored thereon a computer program, characterized in that the program is executed by a processor to implement the white balance processing method according to any one of claims 1-8.
  19. 一种计算机程序产品,其特征在于,当所述计算机程序产品中的指令由处理器执行时,执行如权利要求1-8中任一所述的白平衡处理方法。A computer program product, wherein the white balance processing method according to any one of claims 1-8 is performed when an instruction in the computer program product is executed by a processor.
PCT/CN2018/094971 2017-07-25 2018-07-09 White balance processing method and apparatus, and terminal WO2019019904A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710612896.2A CN107371007A (en) 2017-07-25 2017-07-25 White balancing treatment method, device and terminal
CN201710612896.2 2017-07-25

Publications (1)

Publication Number Publication Date
WO2019019904A1 true WO2019019904A1 (en) 2019-01-31

Family

ID=60307865

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094971 WO2019019904A1 (en) 2017-07-25 2018-07-09 White balance processing method and apparatus, and terminal

Country Status (2)

Country Link
CN (1) CN107371007A (en)
WO (1) WO2019019904A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115278031A (en) * 2022-07-29 2022-11-01 盛泰光电科技股份有限公司 Hyperspectrum-based camera module and image processing method and application thereof

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107371007A (en) * 2017-07-25 2017-11-21 广东欧珀移动通信有限公司 White balancing treatment method, device and terminal
CN108182667B (en) * 2017-12-29 2020-07-17 珠海大横琴科技发展有限公司 Image optimization method, terminal and computer readable storage medium
CN108242178B (en) * 2018-02-26 2021-01-15 北京车和家信息技术有限公司 Parking space detection method and device and electronic equipment
CN108965835B (en) * 2018-08-23 2019-12-27 Oppo广东移动通信有限公司 Image processing method, image processing device and terminal equipment
WO2020252739A1 (en) * 2019-06-20 2020-12-24 深圳市大疆创新科技有限公司 Method and apparatus for acquiring gain coefficient
CN115484384B (en) * 2021-09-13 2023-12-01 华为技术有限公司 Method and device for controlling exposure and electronic equipment
CN116761082B (en) * 2023-08-22 2023-11-14 荣耀终端有限公司 Image processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102387373A (en) * 2010-09-02 2012-03-21 佳能株式会社 Image processing apparatus and image processing method
CN105208360A (en) * 2015-09-23 2015-12-30 青岛海信移动通信技术股份有限公司 Image preview method and device of intelligent terminal and terminal
US20160094825A1 (en) * 2014-09-30 2016-03-31 Acer Incorporated Method for selecting metering mode and image capturing device thereof
CN106713887A (en) * 2017-01-03 2017-05-24 捷开通讯(深圳)有限公司 Mobile terminal, and white balance adjustment method
CN107371007A (en) * 2017-07-25 2017-11-21 广东欧珀移动通信有限公司 White balancing treatment method, device and terminal

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4284448B2 (en) * 2005-01-28 2009-06-24 富士フイルム株式会社 Image processing apparatus and method
JP4217698B2 (en) * 2005-06-20 2009-02-04 キヤノン株式会社 Imaging apparatus and image processing method
CN102572206B (en) * 2010-12-31 2015-05-13 比亚迪股份有限公司 Color correction method
CN103402102B (en) * 2013-07-17 2015-12-09 广东欧珀移动通信有限公司 The method and apparatus of dual camera camera system and white balance adjusting thereof
CN104853172B (en) * 2014-02-19 2017-11-07 联想(北京)有限公司 A kind of information processing method and a kind of electronic equipment
CN105208364A (en) * 2014-06-27 2015-12-30 联想(北京)有限公司 Image white balance control method, device and electronic apparatus
CN105657392A (en) * 2015-04-30 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Image processing method and electronic equipment
CN105898260B (en) * 2016-04-07 2018-01-19 广东欧珀移动通信有限公司 A kind of method and device for adjusting camera white balance
CN106385541A (en) * 2016-09-30 2017-02-08 虹软(杭州)科技有限公司 Method for realizing zooming through wide-angle photographing component and long-focus photographing component
CN106791732A (en) * 2016-11-30 2017-05-31 努比亚技术有限公司 A kind of image processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102387373A (en) * 2010-09-02 2012-03-21 佳能株式会社 Image processing apparatus and image processing method
US20160094825A1 (en) * 2014-09-30 2016-03-31 Acer Incorporated Method for selecting metering mode and image capturing device thereof
CN105208360A (en) * 2015-09-23 2015-12-30 青岛海信移动通信技术股份有限公司 Image preview method and device of intelligent terminal and terminal
CN106713887A (en) * 2017-01-03 2017-05-24 捷开通讯(深圳)有限公司 Mobile terminal, and white balance adjustment method
CN107371007A (en) * 2017-07-25 2017-11-21 广东欧珀移动通信有限公司 White balancing treatment method, device and terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115278031A (en) * 2022-07-29 2022-11-01 盛泰光电科技股份有限公司 Hyperspectrum-based camera module and image processing method and application thereof

Also Published As

Publication number Publication date
CN107371007A (en) 2017-11-21

Similar Documents

Publication Publication Date Title
WO2019019904A1 (en) White balance processing method and apparatus, and terminal
CN110445988B (en) Image processing method, image processing device, storage medium and electronic equipment
CN109644224B (en) System and method for capturing digital images
US11729518B2 (en) Systems and methods for digital photography
WO2020034737A1 (en) Imaging control method, apparatus, electronic device, and computer-readable storage medium
US8896625B2 (en) Method and system for fusing images
JP4236433B2 (en) System and method for simulating fill flash in photography
US9288392B2 (en) Image capturing device capable of blending images and image processing method for blending images thereof
US9148561B2 (en) Image capturing apparatus, executable autoexposure bracketing and control method thereof
CN110445989B (en) Image processing method, image processing device, storage medium and electronic equipment
CN111028190A (en) Image processing method, image processing device, storage medium and electronic equipment
US20140176757A1 (en) Color balance in digital photography
JP6685188B2 (en) Imaging device, image processing device, control method thereof, and program
KR20130138340A (en) White balance optimization with high dynamic range images
KR20080109026A (en) Systems, methods, and apparatus for exposure control
CN110266954B (en) Image processing method, image processing device, storage medium and electronic equipment
JP2006319830A (en) Image processor and image pickup device
WO2020034701A1 (en) Imaging control method and apparatus, electronic device, and readable storage medium
WO2021143300A1 (en) Image processing method and apparatus, electronic device and storage medium
WO2022067762A1 (en) Image processing method and apparatus, photographic device, movable platform, and computer-readable storage medium
CN105163047A (en) HDR (High Dynamic Range) image generation method and system based on color space conversion and shooting terminal
US11601600B2 (en) Control method and electronic device
WO2020034702A1 (en) Control method, device, electronic equipment and computer readable storage medium
JP2024502938A (en) High dynamic range technique selection for image processing
CN116324882A (en) Image signal processing in a multi-camera system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18837954

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18837954

Country of ref document: EP

Kind code of ref document: A1