WO2022067761A1 - 图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质 - Google Patents

图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质 Download PDF

Info

Publication number
WO2022067761A1
WO2022067761A1 PCT/CN2020/119656 CN2020119656W WO2022067761A1 WO 2022067761 A1 WO2022067761 A1 WO 2022067761A1 CN 2020119656 W CN2020119656 W CN 2020119656W WO 2022067761 A1 WO2022067761 A1 WO 2022067761A1
Authority
WO
WIPO (PCT)
Prior art keywords
white balance
parameter
target
color temperature
image
Prior art date
Application number
PCT/CN2020/119656
Other languages
English (en)
French (fr)
Inventor
吴伟霖
胡涛
李琛
滕文猛
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2020/119656 priority Critical patent/WO2022067761A1/zh
Publication of WO2022067761A1 publication Critical patent/WO2022067761A1/zh

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 technical field of image processing, and in particular, to an image processing method, an apparatus, a photographing device, a movable platform, and a computer-readable storage medium.
  • Color temperature refers to the color radiated by a black body (absolute black body) as the temperature increases after being heated. As the temperature increases, the black body first emits red light, and as the temperature continues to increase, it becomes brighter and brighter to yellow, white, and blue light.
  • the color temperature of the light source it is considered that the color of the light emitted by the light source is the same as the color of the light radiated by the black body at a certain temperature, and the black body temperature at this time is called the color temperature of the light source, thus introducing the concept of correlated color temperature.
  • Correlated color temperature mainly refers to the temperature of the most similar black body radiator with the same luminance stimulus.
  • color constancy mainly refers to the perceptual characteristics that people's perception of the color of the surface of the object remains unchanged when the color light irradiated on the surface of the object changes, that is, the visual perception of the color change of the object. invariance. Human beings have a psychological tendency to not change the color judgment of a specific object due to light source or external environmental factors. This tendency is color constancy.
  • AVB Auto White Balance
  • the present application provides an image processing method, an apparatus, a photographing device, a movable platform and a computer-readable storage medium to solve the problem of poor white balance effect in the related art.
  • an image processing method including:
  • the target parameter is related to the brightness of the shooting scene of the image
  • a reference parameter associated with the target parameter from a preset reference database, and obtain a reference color temperature line and a white balance statistical area corresponding to the selected reference parameter; wherein the reference parameter and the shooting scene of the image Brightness is related, and the reference database includes: a plurality of reference parameters, and a reference color temperature line and a white balance statistical area corresponding to each reference parameter;
  • White balance processing is performed on the image according to the target parameter, the selected reference parameter and its corresponding reference color temperature line and white balance statistical area.
  • an image processing apparatus includes a processor and a memory, the memory stores instructions, and the processor implements the following operations when executing the instructions:
  • the target parameter is related to the brightness of the shooting scene of the image
  • a reference parameter associated with the target parameter from a preset reference database, and obtain a reference color temperature line and a white balance statistical area corresponding to the selected reference parameter; wherein the reference parameter and the shooting scene of the image Brightness is related, and the reference database includes: a plurality of reference parameters, and a reference color temperature line and a white balance statistical area corresponding to each reference parameter;
  • White balance processing is performed on the image according to the target parameter, the selected reference parameter and its corresponding reference color temperature line and white balance statistical area.
  • a shooting device including:
  • a lens assembly arranged inside the casing
  • a sensor assembly disposed inside the housing for sensing light passing through the lens assembly and generating electrical signals
  • the image processing apparatus according to the second aspect.
  • a movable platform including:
  • a power system mounted within the body for powering the movable platform
  • the image processing apparatus according to the second aspect.
  • a computer-readable storage medium where several computer instructions are stored thereon, and when the computer instructions are executed, the operations of the method of the first aspect are implemented.
  • the reference database in this solution contains multiple reference parameters, as well as the reference color temperature line and the white balance statistical area corresponding to each reference parameter; different reference parameters are set to simulate the possible occurrences in the actual shooting scene. Therefore, the reference data suitable for the actual environment with different brightness and darkness can be configured; thus, the reference data that matches the brightness of the shooting scene of the image can be selected for white balance during image processing; especially In a low-brightness environment, since the corresponding reference data can be selected, an image captured in a low-brightness environment can also obtain a good white balance effect.
  • FIG. 1 is a schematic diagram of images captured by an imaging system under different lighting conditions according to an embodiment of the present application.
  • FIG. 2A is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 2B is a schematic diagram of a white balance reference data.
  • FIG. 2C , FIG. 2D and FIG. 2E are a plurality of reference parameters according to an embodiment of the present application, and schematic diagrams of reference color temperature lines and white balance statistical regions corresponding to each reference parameter.
  • FIG. 2F is a schematic diagram illustrating an offset between a reference color temperature line relative to a preset standard color temperature line based on FIG. 2E in an embodiment of the present application.
  • FIG. 2G is a schematic diagram of a fusion ratio according to an embodiment of the present application.
  • FIG. 2H is a schematic flowchart of another image processing method shown in this embodiment.
  • FIG. 2I is a schematic flowchart of another image processing method shown in this embodiment.
  • FIG. 3 is a schematic structural diagram of a device for implementing the image processing method of this embodiment.
  • FIG. 4 is a block diagram of a mobile platform according to an embodiment of the present application.
  • FIG. 5 is a block diagram of a camera according to an embodiment of the present application.
  • color constancy mainly refers to the perception that the color of the object surface remains unchanged when the color light irradiated on the surface of the object changes. Characteristics, that is, the invariance of visual perception to the color change of objects. When a specific object has a very different reflection spectrum due to the environment (especially the lighting environment is within a certain range of change), the reflection spectrum of the object will be very different, but the visual recognition system of the human eye can recognize this change, and can judge It is found that the change is caused by the change of the lighting environment.
  • the human recognition mechanism will consider the surface color of the object to be constant within this range of change.
  • Another example is a piece of white A4 paper, over the course of the day you would think that the color of the sunlight changes over time while the A4 paper is still white.
  • the image acquisition device will appear color reproduction distortion, that is, the color of the image is either reddish or bluish.
  • the color of the image output by the camera is reddish; in a light environment with a high color temperature, the color of the image output by the camera is blue.
  • Figure 1 it is a schematic diagram of the image captured by the imaging system under different lighting conditions, where the inconstancy of color is reflected.
  • AVB Auto White Balance
  • the white balance in this state is equivalent to the CCT process in the perception environment, and the effect of the color matrix under the CCT is equivalent to the restoration of various surface colors in the environment and the color constancy of human perception.
  • the resulting image obtained by the imaging system is close to the perceptual constancy of the human eye.
  • the current white balance algorithms mainly include: maximum brightness method (Bright Surface First), gray world method (Gray World), improved gray world method, color gamut limit method, light source prediction method, etc.
  • the sensor data of the scene is used to calculate the gain values of the R, G, and B channels of AWB (Automatic white balance) and the CCT (Correlated color temperature) value of the current scene.
  • AWB Automatic white balance
  • CCT Correlated color temperature
  • the sensor needs to use a larger gain to perceive the image. In this state, there will be more bright and dark dead pixels, and the output signal-to-noise ratio of the sensor will also become worse. The sensor may still be unable to use a larger gain.
  • the signal of the image exhibits normal luminance values. The image is underexposed, and the bright and dark dead pixels and low signal-to-noise ratio of the image cause the white point in the scene to drift on the image, so that the ordinary white balance algorithm cannot identify the white point, and thus cannot.
  • the calculation result of the white balance is obtained, which results in that the image is prone to appear greenish, purpleish, etc., resulting in a poor experience for the user.
  • the present application provides an image processing solution, in which the reference database contains multiple reference parameters, as well as the reference color temperature line and the white balance statistical area corresponding to each reference parameter; different reference parameters are set for the purpose of simulating Various environments with different brightness and darkness levels that may appear in the actual shooting scene, so that the reference data suitable for the actual environment with different brightness and darkness levels can be configured; thus, the reference data that matches the brightness of the shooting scene of the image can be selected during image processing. Perform white balance; especially in a low-brightness environment, since the corresponding reference data can be selected, the images captured in a low-brightness environment can also obtain a good white balance effect.
  • the color temperature line can represent the corresponding Planck line of the device under different brightness environments.
  • the solution of this embodiment can be applied to photographing devices such as cameras or video cameras; it can also be applied to electronic devices equipped with cameras, and the electronic devices here may include devices such as movable platforms or smart phones.
  • the camera has a built-in ISP (Image Signal Processing) unit, which is mainly used to process the output signal of the front-end image sensor.
  • the ISP completes the effect processing of the digital image through a series of digital image processing algorithms. Including 3A (auto exposure, auto focus, auto white balance), dead pixel correction, denoising, glare suppression, backlight compensation, color enhancement, lens shading correction, etc.
  • 3A auto exposure, auto focus, auto white balance
  • dead pixel correction denoising, glare suppression, backlight compensation, color enhancement, lens shading correction, etc.
  • the solution of this embodiment can be applied to an ISP unit in a camera to realize automatic white balance processing of an image.
  • the image for white balance processing in this embodiment may be the original image raw collected by the built-in image sensor of the photographing device, or may be the image generated by the ISP unit in the process of processing the image, such as a YUV or RGB image.
  • the solution of this embodiment can also be applied to image processing software, which can run on tablet computers, smart phones, personal digital assistants (PDAs), laptop computers, desktop computers, or media content players, etc.
  • image processing software may apply the image processing method provided in this embodiment to perform white balance processing on a specified image.
  • FIG. 2A is a flowchart of an image processing method provided by an embodiment of the present application. The method includes the following operations:
  • step 202 an image is acquired, and a target parameter corresponding to the image is determined, and the target parameter is related to the brightness of the shooting scene of the image;
  • a reference parameter associated with the target parameter is selected from a preset reference database, and a reference color temperature line and a white balance statistical area corresponding to the selected reference parameter are obtained; wherein the reference parameter is the same as the selected reference parameter.
  • the brightness of the shooting scene of the image is related, and the reference database includes: a plurality of reference parameters, and a reference color temperature line and a white balance statistical area corresponding to each reference parameter;
  • step 206 white balance processing is performed on the image according to the target parameter, the selected reference parameter and its corresponding reference color temperature line and white balance statistical area.
  • the white point in the image means that the color component of the R channel, the color component of the G channel, and the color component of the B channel of the pixel are equal.
  • this embodiment divides the image into blocks, and each block contains multiple pixels. For the pixels of each block, the brightness values of the R channel of each block are accumulated and averaged, the brightness values of the G channel are accumulated and averaged, and the brightness values of the B channel are accumulated and averaged; then, the G channel is accumulated and averaged.
  • Rgain Ravg/Gavg
  • Bgain Bavg/Gavg.
  • the image is divided into blocks, and the Rgain and Bgain of the image block are known.
  • the white balance reference data As shown in FIG. 2B, a schematic diagram of a white balance reference data is shown, the white balance reference data characterizes the color temperature line and the white balance statistical area, and the Rgain and Bgain of each block are used to match the white balance in the white balance reference data.
  • the balance statistics area is compared, if the Rgain and Bgain of the block fall within the white balance statistics area, that is, the block is a white point, and if it is not within the white balance statistics area, the block is not a white point.
  • an Rgain value is obtained according to the Rgain weighted average of each image block belonging to the white point.
  • the Bgain weighted average of each image block belonging to the white point Get a Bgain value; blocks that do not fall within the white balance statistical area are not white points and do not need to be added to the calculation.
  • the white balance reference data is described by taking Rgain and Bgain as an example for the gain of the pixel.
  • Rgain and Bgain can be used to determine the white balance statistical area.
  • the two gains of Rgain and Ggain can be used to determine the white balance statistical area.
  • use the two gains of Bgain and Ggain to determine the white balance statistical area, or use four-channel gain values, such as R, B, G R gain, and G B gain, to determine the white balance statistical area, or It may also be white balance based on other color spaces, which is not limited in this embodiment.
  • the setting of white balance reference data is one of the key factors affecting the effect of white balance processing.
  • fixed white balance reference data is usually set, and the setting method is usually an empirical value.
  • the white balance reference data is usually set in an ideal state (such as ideal brightness) and is suitable for normal scenes. In a scene with low brightness, the white balance of the low-brightness image is performed by the white balance reference data suitable for normal brightness, which obviously cannot obtain a better processing effect.
  • the reference database contains multiple reference parameters, as well as the reference color temperature line and white balance statistical area corresponding to each reference parameter; different reference parameters are set to simulate various environments with different degrees of brightness and darkness that may appear in the actual shooting scene. , so that reference data suitable for actual environments with different brightness and darkness levels can be configured. These reference data may be generated by collecting images of multiple different standard light sources under different reference parameters in advance, and using the collected images. Next, an embodiment will be used to describe the process of how to obtain the data in the reference database.
  • M kinds of standard light sources and N kinds of different reference parameters can be used to collect images with the device; wherein, the standard light sources may refer to the light sources specified by the International Commission on Illumination for lighting in uniform color measurement.
  • the standard light sources the Determine the corresponding color temperature.
  • a standard light source can be placed on a standard gray card, and the device collects images containing the standard gray card, so that images with different color temperatures and different reference parameters can be collected.
  • process the collected images extract the light source white points of these images, and map them to the Rgain/Bgain space (it can also be Rgain and Ggain, Bgain and Ggain, or four-channel gain value, etc. ), after removing a small number of very special light sources, the distribution of the light sources is used to form an area where the white point is located, that is, the white balance statistics area.
  • the reference parameter may be a parameter related to the brightness of the shooting scene, which represents the brightness of the shooting scene of the image.
  • it may include any one or more of the following: scene brightness parameter, image signal-to-noise ratio, image The exposure parameter of the sensor or the dead pixel parameter of the image sensor.
  • scene brightness parameter LV light value
  • the data in the reference database can be generated from images collected under a variety of different standard light sources and under a variety of different brightnesses. In practical applications, other reference parameters can be used to generate data in the reference database.
  • the generated reference database contains multiple reference parameters, as well as the reference color temperature line and white balance statistical area corresponding to each reference parameter. Different reference parameters correspond to the reference color temperature line and white balance statistical area suitable for the brightness of different shooting scenes. .
  • the scene luminance parameter LV is taken as an example for the reference parameters, and 10 reference parameters are used as an example to show the corresponding reference color temperature line and white balance under the 10 reference parameters.
  • Statistics area wherein the white balance statistics area refers to the area surrounded by irregular graphics, and the curve in this area is the color temperature line; it can be seen that this embodiment implements a three-dimensional white balance calculation method.
  • the number of reference parameters may be flexibly configured as required during specific implementation, which is not limited in this embodiment. As an example, if the hardware computing power of the device is good, multiple reference parameters can be set to match various different brightness environments faced during actual shooting.
  • Fig. 2D shows 4 reference data by taking a two-dimensional space as an example, wherein the reference data PreLV located on the top layer, PreLV refers to the reference data in an ideal state, and the specific reference parameters are not shown in Fig. 2D; in some examples , PreLV can also be included in the reference database as a kind of reference data.
  • Figure 2E shows 4 color temperature lines in the Rgain/Bgain space, which are the color temperature lines corresponding to LV of -2, 3 and 0 respectively, and also includes the color temperature line PreLV under ideal brightness, and the corresponding color temperature lines are not shown in Figure 2E white balance statistics area.
  • white balance can be performed using reference data that is consistent with the brightness of the shooting scene of the image to be processed; specifically, for the image to be processed, the target parameter corresponding to the image is determined;
  • the target parameter selects the reference parameter associated with the target parameter from the reference database, selects the associated reference parameter, and correspondingly selects the reference color temperature line and the white balance statistical area, according to the target parameter, the selected reference parameter and its corresponding
  • the reference color temperature line and the white balance statistical area of are used to perform white balance processing on the image.
  • the target parameters of the image may be the same as or different from the reference parameters in the reference database.
  • the value of the selected reference parameter is the same as the value of the target parameter; in other examples, there are two selected reference parameters; among the plurality of reference parameters, the two reference parameters The value of the parameter has the smallest difference from the value of the target parameter.
  • the reference parameters in the reference database include 10 integers between the interval [-2, 7], assuming that the target parameter LV of the image is 1.0, and the value of the target parameter 1.0 is the same as the reference value in the reference database. If the parameter value 1 is the same, the reference parameter 1.0 is selected, so as to obtain the reference color temperature line and the white balance statistical area corresponding to the reference parameter 1.0, and use the reference color temperature line and the white balance statistical area to white balance the image.
  • the method of selecting the reference parameter can be flexibly configured as needed, for example, one reference parameter with the smallest difference can be selected; this embodiment can also be selected
  • the two with the smallest difference that is, among the multiple reference parameters, the values of the selected two reference parameters have the smallest difference with the value of the target parameter, for example, the reference parameters 1 and 1 with the smallest value difference from the target parameter 1.2 2. Since two reference parameters are selected, the reference color temperature line and the white balance statistics area corresponding to the two reference references are obtained respectively. When the image is white balanced, the reference color temperature line and white balance statistics corresponding to the two reference references are obtained respectively. area is processed.
  • white balance processing is performed on the image according to the target parameter, the selected reference parameter and its corresponding reference color temperature line and white balance statistical area.
  • performing white balance processing on the image according to the target parameter, the selected reference parameter and its corresponding reference color temperature line and white balance statistical region includes:
  • the first target white balance result is determined according to the target parameter, the selected reference parameter and its corresponding reference color temperature line and white balance statistical area.
  • white balance statistical area corresponding to the selected reference parameter based on the white balance statistical area, white pixels can be found from the image, and then the white balance gain can be calculated by using the found white pixels, and the calculation can be used as needed.
  • the obtained white balance gain, as well as the target parameters, the selected reference parameters and their corresponding reference color temperature lines, further perform white balance.
  • two pieces of reference data are obtained for the aforementioned case of selecting two reference parameters.
  • this embodiment uses the two pieces of reference data to perform white balance, and in the processing process, the two pieces of reference data are fused by fusing the two pieces of reference data. the way the data is processed.
  • the reference color temperature line includes a first reference color temperature line and a second reference color temperature line
  • the two reference parameters include a first reference parameter and a second reference parameter. Parameters and their corresponding reference color temperature lines and white balance statistical areas to determine the first target white balance result, including:
  • the first reference white balance result may be determined from the white point found in the image based on the white balance statistical area corresponding to the first reference color temperature line; the second reference white balance result may be based on the second reference color temperature
  • the white balance statistics area corresponding to the line is determined from the white point found in the image.
  • the first reference white balance result and the second reference white balance result are fused to determine the first target white balance result.
  • the values of the two selected reference parameters are 1 and 2, which are referred to as the first reference parameter and the second reference parameter in this embodiment;
  • the first reference white balance result is determined with reference to the color temperature line and the white balance statistics area;
  • the second reference white balance result is determined by using the reference color temperature line and the white balance statistics area corresponding to the second reference parameter.
  • the first target white balance result of the image is obtained by fusing the first reference white balance result and the second reference white balance result.
  • the fusion ratio of the first reference white balance result and the second reference white balance result is determined based on the respective weights of the first reference parameter and the second reference parameter relative to the target parameter.
  • the weight is determined based on differences between the first reference parameter and the second reference parameter and the target parameter, respectively.
  • AWBGain_tmp AWBgain0*lvratio+AWBgain1*(1-lvratio);
  • AWBGain_tmp represents the first target white balance result
  • AWBgain0 represents the first reference white balance result
  • AWBgain1 represents the second reference white balance result
  • lvratio represents the weight between the first reference parameter and the target parameter
  • (1-lvratio) represents the second The weights of the reference parameters and the target parameters actually represent the fusion ratio of AWBgain0 and AWBgain1.
  • lvratio can be calculated by normalizing the difference between the target parameter and the first reference parameter and the second reference parameter, or it can be calculated by using a weighting method; in practical applications, other parameters can also be configured as required.
  • the implementation manner is not limited in this embodiment.
  • the values of the two selected reference parameters are 1 and 2
  • the difference between the target parameter 1.2 and the first reference parameter 1 is 0.2
  • the target parameter 1.2 and the second reference parameter The difference of 1 is 0.8 of the difference of 2.
  • the weight of the white balance result can be set to 0.2.
  • the first target white balance result is obtained, and in some examples, the first target white balance result may be output as the final result.
  • the reference data can be used to find the exact white point, that is, the light source part in the image, and the light source belongs to the brighter area; but there are many other non-light source parts in the image, which are relatively dark, because White point drift may occur. If the first target white balance result is directly used, it may not be possible to perform better color restoration on the non-light source part in the image. Based on this, this embodiment may further process the first target white balance result to obtain a second target white balance result with a better processing effect.
  • a second target white balance result is determined according to the offset of the reference color temperature line relative to the preset standard color temperature line; wherein the preset standard color temperature line is at The color temperature line obtained under the ideal brightness of the shooting scene, such as the aforementioned ideal brightness PreLV; in this embodiment, the offset between the reference color temperature line and the preset standard color temperature line is used to determine the second target white balance result.
  • the second target white balance result may be determined according to the operational relationship between the first target white balance result and the offset.
  • FIG. 2F is used as an example for illustration.
  • FIG. 2F shows the offset of the reference color temperature line relative to the preset standard color temperature line. If the selected reference parameter LV is -2, that is, FIG. 2F In the reference color temperature line corresponding to lv-2, it can be seen from FIG. 2F that there is an offset between the reference color temperature line corresponding to lv-2 and the preset standard color temperature line.
  • the offset includes a color temperature mapping coefficient.
  • the offset between the reference color temperature line and the preset standard color temperature line may be realized by using a color temperature mapping coefficient.
  • the first target white balance result obtained by processing represents the grayscale gain of the image pixel, such as Rgain and Bgain;
  • the color temperature can be determined by Rgain and Bgain, for example, the ratio of Rgain and Bgain falls on the reference color temperature line , the point on the reference color temperature line represents the color temperature; if it does not fall on the reference color temperature line, draw a line with the ratio of Rgain and Bgain as the starting point and perpendicular to the reference color temperature line, the intersection of the line and the reference color temperature line is the color temperature.
  • the points on each color temperature line are the color temperature points.
  • FIG. 2F shows the mapping between the color temperature points on the reference color temperature line corresponding to lv-2 and the corresponding color temperature points on the preset standard color temperature line. Mapping, the color temperature mapping coefficient can be determined according to the mapping relationship between the two.
  • the first reference white balance result includes a first reference correlated color temperature
  • the second reference white balance result includes a second reference correlated color temperature
  • the second target white balance result includes a target correlated color temperature, according to the reference
  • the offset of the color temperature line relative to the preset standard color temperature line determines the second target white balance result, including:
  • the first reference color temperature mapping coefficient and the second reference color temperature mapping coefficient are fused to determine the target color temperature mapping coefficient
  • the second target white balance result is determined according to the target color temperature mapping coefficient.
  • Remap represents the target color temperature mapping coefficient obtained by fusion
  • Remap0 represents the first reference color temperature mapping coefficient
  • Remap1 represents the second reference color temperature mapping coefficient
  • the second target white balance result is determined based on the target color temperature mapping coefficient, for example, the second target white balance result is determined according to the product of the first target white balance result and the target color temperature mapping coefficient.
  • the second target white balance result is obtained based on the above processing.
  • the second target white balance result may be output as the final result; in other examples, further processing may be performed according to actual shooting requirements.
  • the brightness may change greatly during the video shooting. For example, the user shoots a brighter scene at night, and then shoots a darker scene; The difference between the scenes is large. If only the current scene is considered to white balance the video image, it may cause the color jump of the front and back video pictures to be large and have a sudden feeling.
  • the image processing method may further include:
  • the second target white balance result is fused with the pixel correction result of the historical image to determine a third target white balance result.
  • the pixel correction result of the historical image includes: the pixel correction result of the previous frame of the image, or the time domain pixel correction result of the historical image.
  • the shooting scene may be a night scene, usually based on the night scene, a night scene light source parameter is preset, and the night scene light source parameter is used to correct the image captured in the night scene, in order to make the image match the night scene and prevent the image The color is more obtrusive.
  • the preset night scene light source parameters can also be superimposed when the image is white balanced.
  • the image processing method further includes: in response to determining the For the second target white balance result, the second target white balance result is fused with the preset night scene light source parameters to determine the fourth target white balance result.
  • whether the current scene is a night scene is determined by the scene brightness parameter, wherein the threshold can be set as required.
  • the scene brightness of the image is lower than the set threshold, it can be determined that the shooting scene is a night scene, which needs to be superimposed
  • the light source parameters of the night scene are fused to avoid the abrupt feeling of the image color.
  • the fusion ratio of the second target white balance result and the pixel correction result of the historical image is preset. In some examples, the fusion ratio of the second target white balance result and the preset night scene light source parameters is preset. In some examples, the fusion ratio corresponds to the target parameter, and in practical applications, the fusion ratio can be preset as required, for example, the fusion ratio is set based on different target parameters.
  • AWBGain_t is the pixel correction result of the historical image or the night light source parameter
  • AWBGain-Final is the second target white balance result
  • (1-Blend_Ratio) is the fusion ratio of AWBGain_t
  • Blend_ratio is the fusion ratio of AWBGain-Final.
  • FIG. 2G a schematic diagram of a blending ratio (Blend_ratio) is shown. In this embodiment, corresponding blending ratios are preset for different reference parameters.
  • FIG. 2H it is a schematic flowchart of another image processing method shown in this embodiment, including the following operations:
  • Step 211 the image sensor outputs RAW data
  • it can also be an image generated by the ISP unit in the process of processing the image.
  • Step 212 calculating the target parameters of the image through the RAW data
  • the target parameter includes any one or more of the following: scene brightness parameter, image signal-to-noise ratio, image sensor exposure parameter or image sensor dead pixel parameter; this embodiment takes the scene brightness parameter LV value as an example for description.
  • the scene brightness parameter of the image may be determined by the exposure parameter of the image sensor and the average brightness of the image.
  • luma is the weighted average brightness of the raw image
  • dgain and shutter are the exposure parameters of the AE module
  • fnum is the aperture size of the raw data
  • k and b are constants, for example, k is 0.3 and b is 5.1.
  • step 214 the calculated AWB result is fused with the night light source parameter or the correction result of the historical image.
  • Step 215 Transfer the final AWB result obtained by fusion to the ISP system.
  • step 213 as shown in Figure 2I, the following operations are included:
  • Step 2131 obtain the image and the target parameter LV of the image
  • the first reference parameter LV Index0 and the second reference parameter LV Index1 that are associated with the target parameter LV of the image are selected.
  • Step 2132 obtain LV Index0 and LV Index1;
  • the corresponding color temperature curve and white balance statistical area are extracted through LV Index0 and LV Index1.
  • Step 2133 input the color temperature curve and the white balance statistical area corresponding to LV Index0 and LV Index1 respectively as the condition for the AWB algorithm to detect the white point, and perform the AWB calculation respectively;
  • the AWB algorithm can be the gray-scale world method, the maximum brightness method, the improved gray-scale world method, the color gamut boundary method, the frame area segmentation method, the light source prediction method, the perfect reflection method, the dynamic threshold method, and the fuzzy logic method.
  • Step 2134 Calculate the fusion ratio lvratio
  • the calculation process of the fusion ratio lvratio may be: calculating the difference between the target parameter lv and the first reference parameter LV Index0, and calculating the difference between the target reference parameter lv and the second reference parameter LV Index1, and normalizing the calculated two differences
  • the normalization can also be calculated by adopting a weighted method. That is, lvratio represents the weight of the target parameter lv from the first reference parameter LV Index0 (upper boundary), and (1-lvratio) represents the weight of the target parameter lv from the first reference parameter LV Index1 (lower boundary).
  • Step 2135 Calculate the fused target correlated color temperature CCT-final and the first target white balance result AWBGain_tmp according to lvratio;
  • CCT-final CCT0*lvratio+CCT1*(1-lvratio)
  • AWBGain_tmp AWBGain0*lvratio+AWBgain1*(1-lvratio).
  • Step 2136 Calculate the first reference color temperature mapping coefficient and the second reference color temperature mapping coefficient
  • the second reference color temperature mapping coefficient Remap1 (rratio, bratio) is determined.
  • Step 2137 calculate the target color temperature mapping coefficient Remap
  • Remap Remap0*lvratio+Remap1(1-lvratio).
  • Step 2138 calculate and obtain the second target white balance result AWBGain-final
  • step 215AWB and night light source parameters or pixel correction results of historical images may be:
  • Blend_Ratio is obtained in Figure 2G;
  • AWBGain is equal to AWBGain_t in time domain (night light source parameter or pixel correction result of historical image) times (1-Blend_Ratio) plus AWBGain-Final*Blend_ratio.
  • the image processing method of this embodiment can better demonstrate the white balance restoration capability of low-light scenes compared with ordinary white balance algorithms, and provide a more favorable guarantee for the image effect experience of super night scenes .
  • the foregoing method embodiments may be implemented by software, and may also be implemented by hardware or a combination of software and hardware.
  • a device in a logical sense is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory for operation by the image processing processor where it is located.
  • FIG. 3 it is a hardware structure diagram of an image processing apparatus 300 for implementing the image processing method of this embodiment. Except for the processor 301 and the memory 302 shown in FIG. 3 , in the embodiment
  • the image processing device used to implement the image processing method generally may also include other hardware according to the actual function of the image processing device, which will not be repeated here.
  • the processor 301 implements the following operations when executing the computer program:
  • the target parameter is related to the brightness of the shooting scene of the image
  • a reference parameter associated with the target parameter from a preset reference database, and obtain a reference color temperature line and a white balance statistical area corresponding to the selected reference parameter; wherein the reference parameter and the shooting scene of the image Brightness is related, and the reference database includes: a plurality of reference parameters, and a reference color temperature line and a white balance statistical area corresponding to each reference parameter;
  • White balance processing is performed on the image according to the target parameter, the selected reference parameter and its corresponding reference color temperature line and white balance statistical area.
  • the multiple reference parameters included in the reference database, as well as the reference color temperature line and the white balance statistical area corresponding to each reference parameter are obtained by pre-collecting multiple images of different standard light sources under different reference parameters, using generated from the acquired images.
  • the value of the selected reference parameter is the same as the value of the target parameter.
  • two reference parameters are selected; among the plurality of reference parameters, the values of the two reference parameters and the value of the target parameter have the smallest difference.
  • the processor performs white balance processing operations on the image according to the target parameters, the selected reference parameters and their corresponding reference color temperature lines and white balance statistical regions, including:
  • the first target white balance result is determined according to the target parameter, the selected reference parameter and its corresponding reference color temperature line and white balance statistical area.
  • the reference color temperature line includes a first reference color temperature line and a second reference color temperature line
  • the two reference parameters include a first reference parameter and a second reference parameter
  • the processor processes the target parameters according to the target parameters.
  • the selected reference parameter and its corresponding reference color temperature line and white balance statistical area determine the operation of the first target white balance result, including:
  • the first reference white balance result and the second reference white balance result are fused to determine the first target white balance result.
  • the weight is determined based on differences between the first reference parameter and the second reference parameter and the target parameter, respectively.
  • the processor when executing the instructions, further implements the following operations:
  • a second target white balance result is determined according to the offset of the reference color temperature line relative to the preset standard color temperature line.
  • the processor performs the operation of determining the second target white balance result according to the offset of the reference color temperature line relative to the preset standard color temperature line, including:
  • a second target white balance result is determined according to the operational relationship between the first target white balance result and the offset.
  • the offset includes a color temperature mapping coefficient.
  • the first reference white balance result includes a first reference correlated color temperature
  • the second reference white balance result includes a second reference correlated color temperature
  • the second target white balance result includes a target correlated color temperature
  • the The processor performs the operation of determining the second target white balance result according to the offset of the reference color temperature line relative to the preset standard color temperature line, including:
  • the first reference color temperature mapping coefficient and the second reference color temperature mapping coefficient are fused to determine the target color temperature mapping coefficient
  • the second target white balance result is determined according to the target color temperature mapping coefficient.
  • the processor performing the operation of determining the second target white balance result according to the target color temperature mapping coefficient includes:
  • the second target white balance result is determined according to the product of the first target white balance result and the target color temperature mapping coefficient.
  • the image is one frame of images in a continuous shooting scene
  • the processor further implements the following operations when executing the instruction:
  • the second target white balance result is fused with the pixel correction result of the historical image to determine a third target white balance result.
  • the pixel correction result of the historical image includes: the pixel correction result of the previous frame of the image, or the time domain pixel correction result of the historical image.
  • the processor further performs the following operations:
  • the second target white balance result is fused with preset night scene light source parameters to determine a fourth target white balance result.
  • the fusion ratio of the second target white balance result and the pixel correction result of the historical image is preset.
  • the fusion ratio of the second target white balance result and the preset night scene light source parameters is preset.
  • the fusion ratio corresponds to a target parameter.
  • the target parameters include any one or more of the following: a scene brightness parameter, a signal-to-noise ratio of an image, an exposure parameter of the image sensor, or a dead pixel parameter of the image sensor.
  • the scene brightness parameter of the image is determined by the exposure parameter of the image sensor and the average brightness of the image.
  • an embodiment of the application further provides a photographing device 400 , including: a casing 401 ; a lens assembly 402 , which is arranged inside the casing 401 ; and a sensor assembly 403 , which is arranged inside the casing 401 for sensing Pass the light of the lens assembly 402 and generate an electrical signal; and the image processing apparatus 300 according to any one of the embodiments.
  • an embodiment of the present application further provides a movable platform 500, including: a body 501; a power system 502 installed in the body 501 and used to provide power for the movable platform; and any The image processing apparatus 300 described in the embodiment.
  • the movable platform 500 is a vehicle, a drone or a mobile robot.
  • the embodiments of this specification further provide a computer-readable storage medium, where several computer instructions are stored on the readable storage medium, and when the computer instructions are executed, the operations of the image processing method described in any one of the embodiments are performed.
  • Embodiments of the present specification may take the form of a computer program product embodied on one or more storage media having program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.
  • Computer-usable storage media includes permanent and non-permanent, removable and non-removable media, and storage of information can be accomplished by any method or technology.
  • Information may be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • PRAM phase-change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM Electrically Erasable Programmable Read Only Memory
  • Flash Memory or other memory technology
  • CD-ROM Compact Disc Read Only Memory
  • CD-ROM Compact Disc Read Only Memory
  • DVD Digital Versatile Disc
  • Magnetic tape cassettes magnetic tape magnetic disk storage or other magnetic storage devices or any other non-

Landscapes

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

Abstract

一种图像处理方法、装置、拍摄设备(400)、可移动平台(500)及计算机可读存储介质,参考数据库包含有多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;设置不同参考参数,是为了模拟实际拍摄场景下可能出现的各种不同亮暗程度的环境,从而能够配置出适用于实际的不同亮暗程度的环境的参考数据;从而在图像处理时能够选取图像的拍摄场景亮度相符的参考数据进行白平衡;特别是低亮度环境下,由于能够选取到相对应的参考数据,因此在低亮度环境下拍摄的图像,也能够得到很好的白平衡效果。

Description

图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质 技术领域
本申请涉及图像处理技术领域,具体而言,涉及一种图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质。
背景技术
在自然场景中,不同的光源呈现出不同的色温的特性,色温指的是一个不光的黑色物体(绝对黑体)在被加热后随着温度的升高,黑体辐射出的颜色。随着温度的升高,黑体会最先发出红光,随着温度继续升高越来越亮到变成黄光、白光、直到变成蓝光。对于光源来说,认为光源所发射的光的颜色与黑体在某一个温度下所辐射的光的颜色相同,则这个时候的黑体温度称为该光源的色温,由此引入了相关色温的概念。相关色温主要指的是具有相同亮度刺激的颜色最相似的黑体辐射体的温度。
在人体生物学领域中,颜色恒常性主要指的是当照射到物体表面的颜色光发生变化时,人们对该物体表面颜色的知觉仍然保持不变的知觉特性,即视觉对物体颜色变化认知的不变性。人类都有一种不因光源或者外界环境因素而改变对某一个特定物体色彩判断的心理倾向,这种倾向性即为色彩恒常性。然而,普通的成像***是没有办法直接地做到色彩的恒常性。为了达到设备的颜色恒常性,就需要对成像***引入自动白平衡(Auto White Balance,AWB)的概念。
发明内容
有鉴于此,本申请提供一种图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质,以解决相关技术中白平衡效果较差的问题。
第一方面,提供一种图像处理方法,包括:
获取图像,确定与所述图像对应的目标参数,所述目标参数与所述图像的拍摄场景亮度相关;
从预设的参考数据库中选取与所述目标参数相关联的参考参数,并获取与选取的参考参数对应的参考色温线及白平衡统计区域;其中,所述参考参数与所述图像的拍摄场景亮度相关,所述参考数据库包含:多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;
根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理。
第二方面,提供一种图像处理装置,所述装置包括处理器和存储器,所述存储器上存储有指令,所述处理器执行所述指令时实现以下操作:
获取图像,确定与所述图像对应的目标参数,所述目标参数与所述图像的拍摄场景亮度相关;
从预设的参考数据库中选取与所述目标参数相关联的参考参数,并获取与选取的参考参数对应的参考色温线及白平衡统计区域;其中,所述参考参数与所述图像的拍摄场景亮度相关,所述参考数据库包含:多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;
根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理。
第三方面,提供一种拍摄设备,包括:
外壳;
镜头组件,设于所述外壳内部;
传感器组件,设于所述外壳内部,用于感知通过所述镜头组件的光并生成电信号;以及,
如第二方面所述的图像处理装置。
第四方面,提供一种可移动平台,包括:
机体;
动力***,安装在所述机体内,用于为所述可移动平台提供动力;以及,
如第二方面所述的图像处理装置。
第五方面,提供一种计算机可读存储介质,所述可读存储介质上存储有若干计算机指令,所述计算机指令被执行时实现第一方面所述方法的操作。
应用本申请提供的方案,该方案中参考数据库中包含有多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;设置不同参考参数,是为了模拟实际拍摄场景下可能出现的各种不同亮暗程度的环境,从而能够配置出适用于实际的不同亮暗程度的环境的参考数据;从而在图像处理时能够选取图像的拍摄场景亮度相符的参考数据进行白平衡;特别是低亮度环境下,由于能够选取到相对应的参考数据,因此在低亮度环境下拍摄的图像,也能够得到很好的白平衡效果。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个实施例的在不同的光照条件下成像***拍摄的图像的示意图。
图2A是本申请一个实施例的一种图像处理方法的流程图。
图2B是一种白平衡参考数据的示意图。
图2C、图2D和图2E是本申请一个实施例的多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域的示意图。
图2F是本申请一个实施例中在图2E的基础上示出了参考色温线相对于预设标准色温线之间的偏移量的示意图。
图2G是本申请一个实施例的一种融合比例的示意图。
图2H是本实施例示出的另一种图像处理方法的流程示意图。
图2I是本实施例示出的另一种图像处理方法的流程示意图。
图3是用于实施本实施例的图像处理方法的一种设备的结构示意图。
图4是本申请一个实施例的可移动平台的框图。
图5是本申请一个实施例的相机的框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
如果照射物体的光线发生了变化,则光的色温也发生变化,那么,其反映出的色彩也会发生变化。人眼视觉***具有颜色恒常特性,在人体生物学领域中,颜色恒常性主要指的是当照射到物体表面的颜色光发生变化时,人眼对该物体表面颜色的知觉 仍然保持不变的知觉特性,即视觉对物体颜色变化认知的不变性。当某一个特定物体由于环境(尤其特指光照环境在一定的变化范围内)该物体的反射光谱会产生很大的不同,但是人眼的视觉识别***能够识别出来这种的变化,并能够判断出该变化是由于光照环境的变化而产生的,当光照在一定范围内变动的时候,人类识别机制会在这一变化范围内认为物体表面颜色是恒定不变。举例:一朵红玫瑰花,在晴天的时候看是红色的,在阴天的时候也是红色的。另外一个例子是一张白色的A4纸,在一天的时间里面你会认为随着时间的变化阳光颜色的变化而A4纸依旧是白色的。
对于人来说,因为色彩的恒常性维持了人眼对物体表面颜色的认知,而对于一个成像***来说如何做到与人相似的色彩恒常性?其实普通的成像***是没有办法直接地做到色彩的恒常性的。不同光线环境下,图像采集设备会出现彩色还原失真的现象,即图像颜色或者偏红,或者偏蓝等。比如,在色温低的光线环境中,摄像机输出图像颜色偏红;在色温高的光线环境中,摄像机输出的图像颜色偏蓝。如图1所示,是在不同的光照条件下,成像***拍到的图像的示意图,在这里就体现了颜色的不恒常性。
为了达到设备的颜色恒常性,就需要对成像***引入自动白平衡(Auto White Balance,AWB)的概念。白平衡也就是将场景中的“白色”在成像***中还原为“白色”的过程,即将图像中的白块、灰色块等中性色块达到R=G=B的状态。将该状态下的白平衡等效为感知环境中的CCT过程,加上该CCT下颜色矩阵的效果将环境中各种表面颜色还原与人感知的颜色恒常性等效。此时透过成像***得到的结果图像即与人眼感知恒常性相接近。
白平衡算法多种多样,目前的白平衡算法主要有:最大亮度法(Bright Surface First)、灰度世界法(Gray World)、改进的灰度世界法、色域界限法、光源预测法等根据场景的sensor(传感器)数据进行计算AWB(Automatic white balance,自动白平衡)的R、G、B三个通道的增益值和当前场景的CCT(Correlated color temperature,相关色温)值。在普通场景上,这些算法能够起到比较不错的效果。
但是在低照度场景下,传感器感知图像需要采用较大的增益,该状态下会出现较多的亮暗坏点,传感器的输出信噪比也会变差,传感器采用较大增益可能仍然无法将图像的信号呈现出正常的亮度值。图像处于欠曝光的状态,加上图像的亮暗坏点、低信噪比导致场景中的白点在图像上出现白点漂移的问题,从而导致普通的白平衡算法无法识别白点、进而无法得到白平衡的计算结果,从而导致图像出现容易出现偏绿、偏紫等情况,给用户产生较差的体验感。
基于此,本申请提供了一种图像处理方案,该方案中参考数据库中包含有多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;设置不同参考参数,是为了模拟实际拍摄场景下可能出现的各种不同亮暗程度的环境,从而能够配置出适用于实际的不同亮暗程度的环境的参考数据;从而在图像处理时能够选取图像的拍摄场景亮度相符的参考数据进行白平衡;特别是低亮度环境下,由于能够选取到相对应的参考数据,因此在低亮度环境下拍摄的图像,也能够得到很好的白平衡效果。在本申请中,色温线可以表征设备在不同亮度环境下对应的普朗克线。
本实施例方案可应用于如相机或摄像机等拍摄设备;也可应用于搭载有相机的电子设备,此处的电子设备可以包括可移动平台或智能手机等设备。
其中,所述相机内置有ISP(Image Signal Processing,即图像信号处理)单元,主要用来对前端图像传感器输出信号处理的单元,ISP通过一系列数字图像处理算法完成对数字图像的效果处理,主要包括3A(自动曝光、自动对焦、自动白平衡)、坏点校正、去噪、强光抑制、背光补偿、色彩增强、镜头阴影校正等。本实施例的方案可应用于相机中的ISP单元中,实现对图像的自动白平衡处理。其中,本实施例进行白平衡处理的图像可以是拍摄设备内置的图像传感器采集的原始图像raw,也可以是ISP单元在处理图像的过程中产生的图像,例如YUV或RGB图像等。
在另一些例子中,本实施例方案也可以应用于图像处理软件,该图像处理软件可运行于平板电脑、智能手机、个人数字助理(PDA)、膝上计算机、台式计算机或媒体内容播放器等能够处理图像数据的任意电子设备中,该图像处理软件可应用本实施例提供的图像处理方法,对指定的图像进行白平衡处理。
接下来对该图像处理方案进行详细说明。请参见图2A,图2A是本申请实施例提供的一种图像处理方法的流程图,该方法包括以下操作:
在步骤202中,获取图像,确定与所述图像对应的目标参数,所述目标参数与所述图像的拍摄场景亮度相关;
在步骤204中,从预设的参考数据库中选取与所述目标参数相关联的参考参数,并获取与选取的参考参数对应的参考色温线及白平衡统计区域;其中,所述参考参数与所述图像的拍摄场景亮度相关,所述参考数据库包含:多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;
在步骤206中,根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理。
在本实施例中,图像中的白点,是指该像素点的R通道颜色分量、G通道颜色分量和B通道颜色分量相等。
接下来说明图像的白平衡处理过程。出于计算效率的考虑,本实施例将图像进行分块,每个块包含有多个像素点。针对每个块的像素点,将每个块的R通道的亮度值进行累加求平均值,G通道的亮度值进行累加求平均值,B通道的亮度值进行累加求平均值;接着,G通道的平均值除以R通道的平均值得到R通道的灰度增益值Rgain(即Rgain=Gavg/Ravg),G通道的平均值除以B通道的平均值得到B通道的灰度增益值Bgain(即Bgain=Gavg/Bavg),G通道的灰度增益值为1。或者,Rgain=Ravg/Gavg,Bgain=Bavg/Gavg。
本实施例对图像进行分块,知道了图像块的Rgain和Bgain,接下来需要确定这个块是不是白点;而具体的,确定每个块是不是白点,通过白平衡参考数据来确定;如图2B所示,示出了一种白平衡参考数据的示意图,该白平衡参考数据表征了色温线和白平衡统计区域,利用每个块的Rgain和Bgain,与白平衡参考数据中的白平衡统计区域进行对比,若该块的Rgain和Bgain落在白平衡统计区域内,即该块为白点,不在该白平衡统计区域内则该块不是白点。至此,确定出来所有属于白点的图像块,对这些属于白点的图像块,根据各个属于白点的图像块的Rgain加权平均得到一个Rgain值,根据各个属于白点的图像块的Bgain加权平均得到一个Bgain值;未落入该白平衡统计区域内的块不是白点,不需要加入计算。
最后,将加权平均后的Rgain值和Bgain值作用到整张图像中,利用每个像素点的三通道分量分别与对应的gain值相乘得到校正后的三通道分量值。若上述确定gain的公式为G/R=Rgain、G/B=Bgain,则校正时,校正的R通道分量值等于:R乘以加权平均后的Rgain,校正的B通道分量值等于:B乘以加权平均后的Bgain;若上述确定gain的公式为R/G=Rgain、B/G=Bgain,则校正时,校正的R通道分量值等于:R除以加权平均后的Rgain,校正的B通道分量值等于:B除以加权平均后的Bgain。
实际应用中,不同白平衡算法的计算过程略有不同,上述实施例是以灰度世界法为例进行说明的,实际应用中还可以是其他算法,例如最大亮度法、色域界限法、光源预测法、完美反射法、动态阈值法、模糊逻辑法等,本实施例对此不作限定。
上述实施例是通过对图像进行分块来说明的。实际应用中,还可以有其他实现方式,例如可以是不分块的方式,即采用确定图像中每个像素点是否是白点的处理方式;或者,也是采用分块的方式,但在每个块内分别进行白平衡处理。
上述实施例中,是以像素的增益采用Rgain和Bgain为例进行白平衡参考数据的说明,实际应用中还可以采用其他方式,例如可以采用Rgain和Ggain这两个增益来 确定白平衡统计区域,或者采用Bgain和Ggain这两个增益来确定白平衡统计区域,还可以是采用四通道的增益值,比如R,B,G Rgain,G Bgain这四个增益来确定白平衡统计区域,或者还可以是基于其他颜色空间的白平衡,本实施例对此不作限定。
由前述分析可知,白平衡处理过程中,需要准确查找出图像中的白点,因此白平衡参考数据的设置是影响白平衡处理效果的关键因素之一。现有技术中通常是设置固定的白平衡参考数据,设置方式通常是经验值,该白平衡参考数据通常是在理想状态(例如理想亮度)下设置的,适用于正常场景,而针对前述提及的亮度较低的场景,由适用于正常亮度的白平衡参考数据来对低亮度图像进行白平衡,显然无法获得较好的处理效果。
可以理解,对于拍摄设备来说,实际拍摄中常常会面临多种多样的环境,在一次连续拍摄过程中也可能会面临环境的变化;基于此,为了能够适应多种拍摄场景,本实施例中的参考数据库中包含有多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;设置不同参考参数,是为了模拟实际拍摄场景下可能出现的各种不同亮暗程度的环境,从而能够配置出适用于实际的不同亮暗程度的环境的参考数据。这些参考数据可以是通过预先采集多个不同标准光源在不同参考参数下的图像,利用采集到的图像生成的,接下来通过一实施例说明如何获取参考数据库中数据的过程。
首先,可以利用M种标准光源并在N种不同参考参数下,利用设备采集图像;其中,所述标准光源可以是指国际照明委员会为统一颜色测量时的照明所规定的光源,根据标准光源可以确定对应的色温。采集图像的过程,可以是将标准光源打在标准灰卡上,由设备采集包含有标准灰卡的图像,由此可采集到多种不同色温、不同参考参数的图像。之后,对采集的图像进行处理,将这些图像的光源白点提取出来,将其映射至Rgain/Bgain空间(还可以是Rgain和Ggain,Bgain和Ggain,还可以是四通道的增益值等其他方式),剔除掉少部分极为特殊的光源之后,利用光源的分布形成一个白点所在的区域,即白平衡统计区域。
本实施例中,参考参数可以是与拍摄场景亮度相关的参数,表征了图像的拍摄场景亮暗程度,作为例子,可以包括如下任何一个或多个:场景亮度参数、图像的信噪比、图像传感器的曝光参数或图像传感器的坏点参数。以参考参数为场景亮度参数LV(light value)为例,则参考数据库中的数据,可以是采集在多种不同标准光源及多种不同亮度下的图像生成的。实际应用中可以利用其它参考参数生成参考数据库中的数据。
当然,实际应用中也可以采用其他方式实现,例如是经验值,或者还可以是由用户设置等方式;只要能够获得多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域即可,本实施例对此不作限定。
至此,生成的参考数据库中包含了多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域,不同参考参数对应有适用于不同拍摄场景亮度的参考色温线及白平衡统计区域。
如图2C、图2D和图2E所示,在图2C中参考参数以场景亮度参数LV为例,并以10个参考参数为例,示出了10个参考参数下对应参考色温线及白平衡统计区域,其中白平衡统计区域是指不规则图形包围起来的区域,该区域内的曲线即色温线;由此可见,本实施例实现了三维的白平衡计算方法。其中,具体实现时可以根据需要灵活配置参考参数的个数,本实施例对此不做限定。作为例子,如果设备的硬件算力较好,可以设置多个参考参数,以匹配实际拍摄时所面临的各种不同亮度环境。
图2D以二维空间为例示出了4个参考数据,其中位于最上一层的参考数据PreLV,PreLV是指理想状态下的参考数据,该图2D未示出具体的参考参数;在一些例子中,PreLV也可以作为参考数据的一种包含于参考数据库中。
图2E以Rgain/Bgain空间示出了4条色温线,分别为LV为-2、3和0对应的色温 线,还包括了理想亮度下的色温线PreLV,图2E中未示出色温线对应的白平衡统计区域。
基于此,当对图像进行处理时,可以采用与待处理图像的拍摄场景亮度相符的参考数据进行白平衡;具体的,针对需处理的图像,确定与所述图像对应的目标参数;接着通过该目标参数从参考数据库中选取与目标参数相关联的参考参数,选取到相关联的参考参数,对应选取到参考色温线及白平衡统计区域,根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理。
由前述分析可知,参考数据库中的参考参数有多个,而对图像进行白平衡处理时,图像的目标参数可能与参考数据库中的参考参数相同,也可能不同。
在一些例子中,选取的参考参数的取值与所述目标参数的取值相同;在另一些例子中,选取的参考参数有两个;在所述多个参考参数中,所述两个参考参数的取值与所述目标参数的取值差异最小。
以图2C所示实施例为例,参考数据库中的参考参数包括区间[-2,7]之间的10个整数,假设图像的目标参数LV为1.0,目标参数的数值1.0与参考数据库中参考参数数值1相同,则选取到参考参数1.0,从而获取到参考参数1.0对应的参考色温线和白平衡统计区域,并利用该参考色温线和白平衡统计区域对图像进行白平衡。
假设图像的目标参数LV为1.2,目标参数1.2与各个参考参数都不同;此时选取参考参数的方式可以根据需要灵活配置,例如可以选取1个差异最小的参考参数;本实施例还可以是选取差异最小的两个,即在所述多个参考参数中,选取的两个参考参数的取值与所述目标参数的取值差异最小,例如与目标参数1.2取值差异最小的参考参数1和2,由于选取了两个参考参数,获取到两个参考参考分别对应的参考色温线和白平衡统计区域,在图像白平衡时,通过这两个参考参考分别对应的参考色温线和白平衡统计区域进行处理。
本实施例中,根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理。
在一实施例中,所述根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理,包括:
根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,确定第一目标白平衡结果。作为例子,利用选取的参考参数对应的白平衡统计区域,基于白平衡统计区域可以从图像中找出白色像素点,接着利用找出的白色像素点可以计算得到白平衡增益,可以根据需要利用计算得到的白平衡增益,以及目标参数、所选取的参考参数及其对应的参考色温线进一步执行白平衡。
在一些例子中,针对前述选取两个参考参数的情况,获取到两份参考数据,为了提升处理效果,本实施例利用这两份参考数据进行白平衡,在处理过程中通过融合这两份参考数据的方式进行处理。作为例子,所述参考色温线包括第一参考色温线和第二参考色温线,所述两个参考参数包括第一参考参数和第二参考参数,所述根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,确定第一目标白平衡结果,包括:
基于所述第一参考色温线和第二参考色温线分别对应的白平衡统计区域,确定所述第一参考参数和所述第二参考参数分别对应的第一参考白平衡结果和第二参考白平衡结果;其中,第一参考白平衡结果可以是基于第一参考色温线对应的白平衡统计区域,从图像中查找出的白点确定的;第二参考白平衡结果可以是基于第二参考色温线对应的白平衡统计区域,从图像中查找出的白点确定的。
利用所述第一参考参数和第二参考参数分别相对于所述目标参数的权值,将所述第一参考白平衡结果和第二参考白平衡结果进行融合,确定第一目标白平衡结果。
仍以前述目标参数的取值为1.2为例,选取的两个参考参数的取值为1和2,本实 施例称之为第一参考参数和第二参考参数;利用第一参考参数对应的参考色温线及白平衡统计区域,确定第一参考白平衡结果;利用第二参考参数对应的参考色温线及白平衡统计区域,确定第二参考白平衡结果。最后利用第一参考白平衡结果和第二参考白平衡结果融合得到图像的第一目标白平衡结果。
其中,第一参考白平衡结果和第二参考白平衡结果的融合比例,是基于所述第一参考参数和第二参考参数分别相对于所述目标参数的权值确定的。在一些例子中,所述权值是基于所述第一参考参数和第二参考参数分别与所述目标参数的差值而确定的。
作为例子,以如下式子示出上述融合过程:
AWBGain_tmp=AWBgain0*lvratio+AWBgain1*(1-lvratio);
其中,AWBGain_tmp表示第一目标白平衡结果,AWBgain0表示第一参考白平衡结果,AWBgain1表示第二参考白平衡结果,lvratio表示第一参考参数与目标参数的权值,(1-lvratio)表示第二参考参数与目标参数的权值,这两个权值实际上也表征了AWBgain0和AWBgain1的融合比例。
在一些例子中,lvratio可以通过目标参数与第一参考参数和第二参考参数之间的差异进行归一化计算得到,也可以通过采用加权的方式来计算;实际应用中还可以根据需要配置其他实现方式,本实施例对此不作限定。
作为例子,以目标参数的取值为1.2为例,选取的两个参考参数的取值为1和2,目标参数1.2与第一参考参数1的差异是0.2,目标参数1.2与第二参考参数1的差异是2的差异0.8,差异越小,则相应的权值越大;第一参考参数对应的第一参考白平衡结果的权值可以设置为0.8,第二参考参数对应的第二参考白平衡结果的权值可以设置为0.2。
通过上述处理,获得了第一目标白平衡结果,在一些例子中,第一目标白平衡结果可以作为最终结果输出。
而在另一些例子中,利用参考数据能够找出准确的白点,也即是图像中光源部分,光源属于较亮的区域;但图像中还有很多其他非光源的部分,相对较暗,由于可能出现白点漂移现象,若直接利用第一目标白平衡结果,可能无法对图像中的非光源部分进行较好的色彩还原。基于此,本实施例还可以进一步对第一目标白平衡结果进行处理,得到处理效果更好的第二目标白平衡结果。作为例子,响应于确定所述第一目标白平衡结果,根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果;其中,预设标准色温线是在理想的拍摄场景亮度下获得的色温线,如前述的理想亮度PreLV;本实施例利用参考色温线相对于预设标准色温线之间的偏移量来确定第二目标白平衡结果。
在一些例子中,可以根据所述第一目标白平衡结果和所述偏移量的运算关系,确定第二目标白平衡结果。
以图2F为例进行说明,图2F是在图2E的基础上示出了参考色温线相对于预设标准色温线之间的偏移量,若选取的参考参数LV为-2,即图2F中lv-2所对应的参考色温线,由图2F可以看出,lv-2所对应的参考色温线与预设标准色温线之间存在偏移。
在一些例子中,所述偏移量包括色温映射系数。本实施例中,参考色温线与预设标准色温线之间偏移量,可以是采用色温映射系数实现。作为例子,由前述可知,处理得到的第一目标白平衡结果表征了图像像素的灰度增益,例如Rgain和Bgain;通过Rgain和Bgain可确定色温,例如Rgain和Bgain的比值落在参考色温线上,则参考色温线上该点即表示色温;若未落在参考色温线上,以Rgain和Bgain的比值为起点画线并垂直于参考色温线,该线条与参考色温线的交点即为色温。如图2F所示,各条色温线上的点即为色温点,图2F示出了lv-2所对应的参考色温线上色温点映射至预设标准色温线上对应色温点的之间的映射,根据两者的映射关系可确定色温映射系数。
前述实施例中涉及选取两个参考参数的情况,针对此情况,需要对两个参考参数分别对应的色温映射系数进行融合。作为例子,所述第一参考白平衡结果包括第一参考相关色温,所述第二参考白平衡结果包括第二参考相关色温,所述第二目标白平衡结果包括目标相关色温,根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果,包括:
根据所述目标相关色温,确定所述第一参考参数和所述第二参考参数分别对应的第一参考色温映射系数和第二参考色温映射系数;
利用所述权值,将所述第一参考色温映射系数和第二参考色温映射系数进行融合,确定目标色温映射系数;
根据所述目标色温映射系数,确定所述第二目标白平衡结果。
作为例子,通过如下式子进行说明:
Remap=Remap0*lvratio+Remap1(1-lvratio)
其中,Remap表示融合得到的目标色温映射系数,Remap0表示第一参考色温映射系数,Remap1表示第二参考色温映射系数;lvratio即前述的权值,可参考前述实施例的说明。上述式子只是示意,实际应用中还可以采用其他方式进行融合,本实施例对此不做限定。
基于目标色温映射系数,确定所述第二目标白平衡结果,例如,根据所述第一目标白平衡结果与所述目标色温映射系数的乘积,确定所述第二目标白平衡结果。
基于上述处理获得了第二目标白平衡结果,在一些例子中,第二目标白平衡结果可以作为最终结果输出;在另一些例子中,还可以根据实际的拍摄需求进一步执行处理。
作为例子,在连续拍摄场景下,如拍摄视频,视频拍摄过程中可能出现亮度变化较大的情况,例如夜晚下用户对着较亮的场景拍摄,之后又对着较暗的场景拍摄;由于前后场景的差异较大,如果只考虑当前场景对视频图像进行白平衡,则可能导致前后视频画面色彩跳变较大而具有突兀感。基于此,在一些例子中,对于连续拍摄场景下的其中一帧图像,图像处理方法还可包括:
响应于确定所述第二目标白平衡结果,将所述第二目标白平衡结果与历史图像的像素校正结果进行融合,确定第三目标白平衡结果。
本实施例中,针对连续拍摄场景下的其中一帧图像的第二目标白平衡结果,还可以结合历史图像的像素校正结果进行融合,确定第三目标白平衡结果;由于参考了历史图像的校正结果进行融合,从而可以使连续拍摄场景下视频画面色彩过渡平滑,减少突兀感。
在一些例子中,所述历史图像的像素校正结果包括:所述图像的上一帧图像的像素校正结果,或者是历史图像的时域像素校正结果。
在另一些例子中,拍摄场景可能是在夜晚场景,通常基于夜晚场景预设有夜景光源参数,该夜景光源参数用于对夜晚场景拍摄的图像进行校正,为了使图像与夜晚场景相符、防止图像色彩较为突兀,本实施例在图像白平衡时还可以叠加预设的夜景光源参数,作为例子,若所述图像的场景亮度参数低于设定阈值,图像处理方法还包括:响应于确定所述第二目标白平衡结果,将所述第二目标白平衡结果与预设的夜景光源参数进行融合,确定第四目标白平衡结果。本实施例中通过场景亮度参数来确定当前场景是否为夜晚场景,其中,所述阈值可以根据需要进行设置,当图像的场景亮度低于该设定阈值,可以确定拍摄场景为夜晚场景,需要叠加夜景光源参数进行融合,从而避免图像色彩的突兀感。
在一些例子中,所述第二目标白平衡结果与所述历史图像的像素校正结果的融合比例是预先设定的。在一些例子中,所述第二目标白平衡结果与所述预设的夜景光源参数的融合比例是预先设定的。在一些例子中,所述融合比例与目标参数相对应,实 际应用中可以根据需要预设该融合比例,例如基于不同目标参数设定该融合比例。
以如下式子为例:
AWBGain_t*(1-Blend_Ratio)+AWBGain-Final*Blend_ratio;
其中,AWBGain_t为历史图像的像素校正结果或夜晚光源参数,AWBGain-Final为第二目标白平衡结果,(1-Blend_Ratio)为AWBGain_t的融合比例,Blend_ratio为AWBGain-Final的融合比例。如图2G所示,示出了一种融合比例(Blend_ratio)的示意图,本实施例预先针对不同参考参数设定对应的融合比例。
接下来再通过一实施例对图像处理方案进行说明。如图2H所示,是本实施例示出的另一种图像处理方法的流程示意图,包括如下操作:
步骤211、图像传感器输出RAW数据;
在另一些例子,还可以是ISP单元在处理图像的过程中产生的图像。
步骤212、通过RAW数据计算图像的目标参数;
目标参数包括如下任何一个或多个:场景亮度参数、图像的信噪比、图像传感器的曝光参数或图像传感器的坏点参数;本实施例以场景亮度参数LV值为例进行说明。
其中,图像的场景亮度参数,可以是通过所述图像传感器的曝光参数以及所述图像的平均亮度确定的。
作为例子,可以采用如下计算方式:
Figure PCTCN2020119656-appb-000001
其中,luma为raw图像的加权平均亮度,again、dgain和shutter为AE模块的曝光参数,fnum为拍摄raw数据的光圈大小,k、b为常数,例如k为0.3,b为5.1。
步骤213、三维参考数据的AWB计算。
步骤214、计算得到的AWB结果与夜晚光源参数或历史图像的校正结果融合。
步骤215、将融合得到的AWB最终结果传递到ISP***中。
其中,针对步骤213,如图2I所示,包括如下操作:
步骤2131、获取图像及图像的目标参数LV;
通过图像的目标参数LV选取计相关联的第一参考参数LV Index0和第二参考参数LV Index1。
步骤2132、获取LV Index0和LV Index1;
通过LV Index0和LV Index1提取出对应的色温曲线及白平衡统计区域。
步骤2133、将LV Index0和LV Index1分别对应的色温曲线及白平衡统计区域作为AWB算法检测白点的条件进行输入,分别进行AWB计算;
分别计算出第一参考白平衡结果AWBgain0、第一参考相关色温CCT0、第二参考白平衡结果AWBgain1和第二参考相关色温CCT1;
其中AWB算法可以是采用灰度世界法、最大亮度法、改进的灰度世界法、色域界限法、图框区域分割法、光源预测法、完美反射法、动态阈值法、模糊逻辑法等。
步骤2134、计算融合比例lvratio;
融合比例lvratio的计算过程,可以是:计算目标参数lv与第一参考参数LV Index0的差值,以及计算目标参考参数lv与第二参考参数LV Index1的差值,将计算的两个差值归一化,也可以通过采用加权的方式来计算得到。即lvratio表示目标参数lv距离第一参考参数LV Index0(上边界)的权重,(1-lvratio)表示目标参数lv距离第一参考参数LV Index1(下边界)的权重。
步骤2135、根据lvratio计算融合后的目标相关色温CCT-final和第一目标白平衡结果AWBGain_tmp;
其中CCT-final=CCT0*lvratio+CCT1*(1-lvratio),AWBGain_tmp= AWBGain0*lvratio+AWBgain1*(1-lvratio)。
步骤2136、计算第一参考色温映射系数和第二参考色温映射系数;
作为例子,根据CCT-final在LVIndex0对应的参考色温线上的位置,确定第一参考色温映射系数Remap0(rratio,bratio);
根据CCT-final在LVIndex1对应的参考色温线上的位置,确定第二参考色温映射系数Remap1(rratio,bratio)。
步骤2137、计算目标色温映射系数Remap;
根据lvratio计算最终的色温映射系数Remap(rratio,bratio):
Remap=Remap0*lvratio+Remap1(1-lvratio)。
步骤2138、计算得到第二目标白平衡结果AWBGain-final;
AWBGain_tmp通过色温映射系数进行映射,映射的方式可以是AWBGain-final=AWBGain_tmp*Remap。
针对步骤215AWB与夜晚光源参数或者历史图像的像素校正结果融合过程可以是:
根据目标参数lv在图2G中得到对应的Blend_Ratio;
计算AWBGain,AWBGain等于时域的AWBGain_t(夜晚光源参数或者历史图像的像素校正结果)乘以(1-Blend_Ratio)加上AWBGain-Final*Blend_ratio。
在低照度场景下,利用本实施例图像处理方法处理得到图像,相对于普通白平衡算法处理得到的图像,能够更好地还原色彩,白平衡处理效果较好。
在低亮度环境下拍摄视频为例,利用本实施例图像处理方法相对于普通白平衡算法,能够很好的展现低照场景的白平衡还原能力,为超级夜景的图像效果体验提供更有利的保障。
上述方法实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在图像处理的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图3所示,为实施本实施例图像处理方法的图像处理装置300的一种硬件结构图,除了图3所示的处理器301、存储器302之外,实施例中用于实施本图像处理方法的图像处理设备,通常根据该图像处理设备的实际功能,还可以包括其他硬件,对此不再赘述。
本实施例中,所述处理器301执行所述计算机程序时实现以下操作:
获取图像,确定与所述图像对应的目标参数,所述目标参数与所述图像的拍摄场景亮度相关;
从预设的参考数据库中选取与所述目标参数相关联的参考参数,并获取与选取的参考参数对应的参考色温线及白平衡统计区域;其中,所述参考参数与所述图像的拍摄场景亮度相关,所述参考数据库包含:多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;
根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理。
在一些例子中,所述参考数据库包含的多个参考参数,以及每个参考参数对应的参考色温线和白平衡统计区域,是通过预先采集多个不同标准光源在不同参考参数下的图像,利用采集到的图像生成的。
在一些例子中,选取的参考参数的取值与所述目标参数的取值相同。
在一些例子中,选取的参考参数有两个;在所述多个参考参数中,所述两个参考参数的取值与所述目标参数的取值差异最小。
在一些例子中,所述处理器根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理的操作,包括:
根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,确定第一目标白平衡结果。
在一些例子中,所述参考色温线包括第一参考色温线和第二参考色温线,所述两个参考参数包括第一参考参数和第二参考参数,所述处理器处理根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,确定第一目标白平衡结果的操作,包括:
基于所述第一参考色温线和第二参考色温线分别对应的白平衡统计区域,确定所述第一参考参数和所述第二参考参数分别对应的第一参考白平衡结果和第二参考白平衡结果;
利用所述第一参考参数和第二参考参数分别相对于所述目标参数的权值,将所述第一参考白平衡结果和第二参考白平衡结果进行融合,确定第一目标白平衡结果。
在一些例子中,所述权值是基于所述第一参考参数和第二参考参数分别与所述目标参数的差值而确定的。
在一些例子中,所述处理器执行所述指令时还实现以下操作:
响应于确定所述第一目标白平衡结果,根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果。
在一些例子中,所述处理器执行所述根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果的操作,包括:
根据所述第一目标白平衡结果和所述偏移量的运算关系,确定第二目标白平衡结果。
在一些例子中,所述偏移量包括色温映射系数。
在一些例子中,所述第一参考白平衡结果包括第一参考相关色温,所述第二参考白平衡结果包括第二参考相关色温,所述第二目标白平衡结果包括目标相关色温,所述处理器执行所述根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果的操作,包括:
根据所述目标相关色温,确定所述第一参考参数和所述第二参考参数分别对应的第一参考色温映射系数和第二参考色温映射系数;
利用所述权值,将所述第一参考色温映射系数和第二参考色温映射系数进行融合,确定目标色温映射系数;
根据所述目标色温映射系数,确定所述第二目标白平衡结果。
在一些例子中,所述处理器执行所述根据所述目标色温映射系数,确定所述第二目标白平衡结果的操作,包括:
根据所述第一目标白平衡结果与所述目标色温映射系数的乘积,确定所述第二目标白平衡结果。
在一些例子中,所述图像为连续拍摄场景下的其中一帧图像,所述处理器执行所述指令时还实现以下操作:
响应于确定所述第二目标白平衡结果,将所述第二目标白平衡结果与历史图像的像素校正结果进行融合,确定第三目标白平衡结果。
在一些例子中,所述历史图像的像素校正结果包括:所述图像的上一帧图像的像素校正结果,或者是历史图像的时域像素校正结果。
在一些例子中,若所述图像的场景亮度参数低于设定阈值,所述处理器还执行如下操作:
响应于确定所述第二目标白平衡结果,将所述第二目标白平衡结果与预设的夜景光源参数进行融合,确定第四目标白平衡结果。
在一些例子中,所述第二目标白平衡结果与所述历史图像的像素校正结果的融合比例是预先设定的。
在一些例子中,所述第二目标白平衡结果与所述预设的夜景光源参数的融合比例是预先设定的。
在一些例子中,所述融合比例与目标参数相对应。
在一些例子中,所述目标参数包括如下任何一个或多个:场景亮度参数、图像的信噪比、图像传感器的曝光参数或图像传感器的坏点参数。
在一些例子中,所述图像的场景亮度参数,是通过所述图像传感器的曝光参数以及所述图像的平均亮度确定的。
如图4所示,是申请实施例还提供一种拍摄设备400,包括:外壳401;镜头组件402,设于所述外壳401内部;传感器组件403,设于所述外壳401内部,用于感知通过所述镜头组件402的光并生成电信号;以及任一实施例所述的图像处理装置300。
如图5所示,本申请实施例还提供一种可移动平台500,包括:机体501;动力***502,安装在所述机体501内,用于为所述可移动平台提供动力;以及任一实施例所述的图像处理装置300。
可选地,所述可移动平台500为车辆、无人机或者可移动机器人。
本说明书实施例还提供一种计算机可读存储介质,所述可读存储介质上存储有若干计算机指令,所述计算机指令被执行时实任一实施例所述图像处理方法的操作。
本说明书实施例可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机可用存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括但不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上对本发明实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (44)

  1. 一种图像处理方法,其特征在于,包括:
    获取图像,确定与所述图像对应的目标参数,所述目标参数与所述图像的拍摄场景亮度相关;
    从预设的参考数据库中选取与所述目标参数相关联的参考参数,并获取与选取的参考参数对应的参考色温线及白平衡统计区域;其中,所述参考参数与所述图像的拍摄场景亮度相关,所述参考数据库包含:多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;
    根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理。
  2. 根据权利要求1所述的方法,其特征在于,所述参考数据库包含的多个参考参数,以及每个参考参数对应的参考色温线和白平衡统计区域,是通过预先采集多个不同标准光源在不同参考参数下的图像,利用采集到的图像生成的。
  3. 根据权利要求2所述的方法,其特征在于,选取的参考参数的取值与所述目标参数的取值相同。
  4. 根据权利要求2所述的方法,其特征在于,选取的参考参数有两个;在所述多个参考参数中,所述两个参考参数的取值与所述目标参数的取值差异最小。
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理,包括:
    根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,确定第一目标白平衡结果。
  6. 根据权利要求5所述的方法,其特征在于,所述参考色温线包括第一参考色温线和第二参考色温线,所述两个参考参数包括第一参考参数和第二参考参数,所述根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,确定第一目标白平衡结果,包括:
    基于所述第一参考色温线和第二参考色温线分别对应的白平衡统计区域,确定所述第一参考参数和所述第二参考参数分别对应的第一参考白平衡结果和第二参考白平衡结果;
    利用所述第一参考参数和第二参考参数分别相对于所述目标参数的权值,将所述第一参考白平衡结果和第二参考白平衡结果进行融合,确定第一目标白平衡结果。
  7. 根据权利要求6所述的方法,其特征在于,所述权值是基于所述第一参考参数和第二参考参数分别与所述目标参数的差值而确定的。
  8. 根据权利要求5或6所述的方法,其特征在于,所述方法还包括:
    响应于确定所述第一目标白平衡结果,根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果,包括:
    根据所述第一目标白平衡结果和所述偏移量的运算关系,确定第二目标白平衡结果。
  10. 根据权利要求8所述的方法,其特征在于,所述偏移量包括色温映射系数。
  11. 根据权利要求10所述的方法,其特征在于,所述第一参考白平衡结果包括第一参考相关色温,所述第二参考白平衡结果包括第二参考相关色温,所述第二目标白平衡结果包括目标相关色温;所述根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果,包括:
    根据所述目标相关色温,确定所述第一参考参数和所述第二参考参数分别对应的 第一参考色温映射系数和第二参考色温映射系数;
    利用所述权值,将所述第一参考色温映射系数和第二参考色温映射系数进行融合,确定目标色温映射系数;
    根据所述目标色温映射系数,确定所述第二目标白平衡结果。
  12. 根据权利要求11所述的方法,其特征在于,所述根据所述目标色温映射系数,确定所述第二目标白平衡结果,包括:
    根据所述第一目标白平衡结果与所述目标色温映射系数的乘积,确定所述第二目标白平衡结果。
  13. 根据权利要求6所述的方法,其特征在于,所述图像为连续拍摄场景下的其中一帧图像,所述方法还包括:
    响应于确定所述第二目标白平衡结果,将所述第二目标白平衡结果与历史图像的像素校正结果进行融合,确定第三目标白平衡结果。
  14. 根据权利要求13所述的方法,其特征在于,所述历史图像的像素校正结果包括:所述图像的上一帧图像的像素校正结果,或者是历史图像的时域像素校正结果。
  15. 根据权利要求6所述的方法,其特征在于,若所述图像的场景亮度参数低于设定阈值,还包括:
    响应于确定所述第二目标白平衡结果,将所述第二目标白平衡结果与预设的夜景光源参数进行融合,确定第四目标白平衡结果。
  16. 根据权利要求13所述的方法,其特征在于,所述第二目标白平衡结果与所述历史图像的像素校正结果的融合比例是预先设定的。
  17. 根据权利要求16所述的方法,其特征在于,所述第二目标白平衡结果与所述预设的夜景光源参数的融合比例是预先设定的。
  18. 根据权利要求16或17所述的方法,其特征在于,所述融合比例是与所述目标参数相对应。
  19. 根据权利要求1所述的方法,其特征在于,所述目标参数包括如下任何一个或多个:场景亮度参数、图像的信噪比、图像传感器的曝光参数或图像传感器的坏点参数。
  20. 根据权利要求19所述的方法,其特征在于,所述图像的场景亮度参数,是通过所述图像传感器的曝光参数以及所述图像的平均亮度确定的。
  21. 一种图像处理装置,其特征在于,所述装置包括处理器和存储器,所述存储器上存储有指令,所述处理器执行所述指令时实现以下操作:
    获取图像,确定与所述图像对应的目标参数,所述目标参数与所述图像的拍摄场景亮度相关;
    从预设的参考数据库中选取与所述目标参数相关联的参考参数,并获取与选取的参考参数对应的参考色温线及白平衡统计区域;其中,所述参考参数与所述图像的拍摄场景亮度相关,所述参考数据库包含:多个参考参数,以及每个参考参数对应的参考色温线及白平衡统计区域;
    根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理。
  22. 根据权利要求21所述的装置,其特征在于,所述参考数据库包含的多个参考参数,以及每个参考参数对应的参考色温线和白平衡统计区域,是通过预先采集多个不同标准光源在不同参考参数下的图像,利用采集到的图像生成的。
  23. 根据权利要求22所述的装置,其特征在于,选取的参考参数的取值与所述目标参数的取值相同。
  24. 根据权利要求22所述的装置,其特征在于,选取的参考参数有两个;在所 述多个参考参数中,所述两个参考参数的取值与所述目标参数的取值差异最小。
  25. 根据权利要求21所述的装置,其特征在于,所述处理器根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,对所述图像进行白平衡处理的操作,包括:
    根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,确定第一目标白平衡结果。
  26. 根据权利要求25所述的装置,其特征在于,所述参考色温线包括第一参考色温线和第二参考色温线,所述两个参考参数包括第一参考参数和第二参考参数,所述处理器处理根据所述目标参数、所选取的参考参数及其对应的参考色温线及白平衡统计区域,确定第一目标白平衡结果的操作,包括:
    基于所述第一参考色温线和第二参考色温线分别对应的白平衡统计区域,确定所述第一参考参数和所述第二参考参数分别对应的第一参考白平衡结果和第二参考白平衡结果;
    利用所述第一参考参数和第二参考参数分别相对于所述目标参数的权值,将所述第一参考白平衡结果和第二参考白平衡结果进行融合,确定第一目标白平衡结果。
  27. 根据权利要求26所述的装置,其特征在于,所述权值是基于所述第一参考参数和第二参考参数分别与所述目标参数的差值而确定的。
  28. 根据权利要求25或26所述的装置,其特征在于,所述处理器执行所述指令时还实现以下操作:
    响应于确定所述第一目标白平衡结果,根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果。
  29. 根据权利要求28所述的装置,其特征在于,所述处理器执行所述根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果的操作,包括:
    根据所述第一目标白平衡结果和所述偏移量的运算关系,确定第二目标白平衡结果。
  30. 根据权利要求28所述的装置,其特征在于,所述偏移量包括色温映射系数。
  31. 根据权利要求30所述的装置,其特征在于,所述第一参考白平衡结果包括第一参考相关色温,所述第二参考白平衡结果包括第二参考相关色温,所述第二目标白平衡结果包括目标相关色温,所述处理器执行所述根据所述参考色温线相对于预设标准色温线的偏移量,确定第二目标白平衡结果的操作,包括:
    根据所述目标相关色温,确定所述第一参考参数和所述第二参考参数分别对应的第一参考色温映射系数和第二参考色温映射系数;
    利用所述权值,将所述第一参考色温映射系数和第二参考色温映射系数进行融合,确定目标色温映射系数;
    根据所述目标色温映射系数,确定所述第二目标白平衡结果。
  32. 根据权利要求31所述的装置,其特征在于,所述处理器执行所述根据所述目标色温映射系数,确定所述第二目标白平衡结果的操作,包括:
    根据所述第一目标白平衡结果与所述目标色温映射系数的乘积,确定所述第二目标白平衡结果。
  33. 根据权利要求26所述的装置,其特征在于,所述图像为连续拍摄场景下的其中一帧图像,所述处理器执行所述指令时还实现以下操作:
    响应于确定所述第二目标白平衡结果,将所述第二目标白平衡结果与历史图像的像素校正结果进行融合,确定第三目标白平衡结果。
  34. 根据权利要求33所述的装置,其特征在于,所述历史图像的像素校正结果包括:所述图像的上一帧图像的像素校正结果,或者是历史图像的时域像素校正结果。
  35. 根据权利要求26所述的装置,其特征在于,若所述图像的场景亮度参数低 于设定阈值,所述处理器还执行如下操作:
    响应于确定所述第二目标白平衡结果,将所述第二目标白平衡结果与预设的夜景光源参数进行融合,确定第四目标白平衡结果。
  36. 根据权利要求33所述的装置,其特征在于,所述第二目标白平衡结果与所述历史图像的像素校正结果的融合比例是预先设定的。
  37. 根据权利要求36所述的装置,其特征在于,所述第二目标白平衡结果与所述预设的夜景光源参数的融合比例是预先设定的。
  38. 根据权利要求36或37所述的装置,其特征在于,所述融合比例与目标参数相对应。
  39. 根据权利要求21所述的装置,其特征在于,所述目标参数包括如下任何一个或多个:场景亮度参数、图像的信噪比、图像传感器的曝光参数或图像传感器的坏点参数。
  40. 根据权利要求39所述的装置,其特征在于,所述图像的场景亮度参数,是通过所述图像传感器的曝光参数以及所述图像的平均亮度确定的。
  41. 一种拍摄设备,其特征在于,包括:
    外壳;
    镜头组件,设于所述外壳内部;
    传感器组件,设于所述外壳内部,用于感知通过所述镜头组件的光并生成电信号;以及,
    如权利要求21至40任意一项所述的图像处理装置。
  42. 一种可移动平台,其特征在于,包括:
    机体;
    动力***,安装在所述机体内,用于为所述可移动平台提供动力;以及,
    如权利要求21至40任意一项所述的图像处理装置。
  43. 根据权利要求41所述的可移动平台,其特征在于,所述可移动平台为车辆、无人机或者可移动机器人。
  44. 一种计算机可读存储介质,其特征在于,所述可读存储介质上存储有若干计算机指令,所述计算机指令被执行时实现权利要求1至20任一项所述方法的操作。
PCT/CN2020/119656 2020-09-30 2020-09-30 图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质 WO2022067761A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/119656 WO2022067761A1 (zh) 2020-09-30 2020-09-30 图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/119656 WO2022067761A1 (zh) 2020-09-30 2020-09-30 图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2022067761A1 true WO2022067761A1 (zh) 2022-04-07

Family

ID=80949414

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119656 WO2022067761A1 (zh) 2020-09-30 2020-09-30 图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质

Country Status (1)

Country Link
WO (1) WO2022067761A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055699A (zh) * 2022-07-28 2023-05-02 荣耀终端有限公司 一种图像处理方法及相关电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050286097A1 (en) * 2004-06-25 2005-12-29 Szepo Hung Automatic white balance method and apparatus
CN104935903A (zh) * 2014-03-18 2015-09-23 韩华泰科株式会社 白平衡校正设备和白平衡校正方法
CN109729332A (zh) * 2018-12-12 2019-05-07 珠海亿智电子科技有限公司 一种自动白平衡矫正方法和***
CN111698493A (zh) * 2020-06-02 2020-09-22 Oppo广东移动通信有限公司 白平衡处理方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050286097A1 (en) * 2004-06-25 2005-12-29 Szepo Hung Automatic white balance method and apparatus
CN104935903A (zh) * 2014-03-18 2015-09-23 韩华泰科株式会社 白平衡校正设备和白平衡校正方法
CN109729332A (zh) * 2018-12-12 2019-05-07 珠海亿智电子科技有限公司 一种自动白平衡矫正方法和***
CN111698493A (zh) * 2020-06-02 2020-09-22 Oppo广东移动通信有限公司 白平衡处理方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055699A (zh) * 2022-07-28 2023-05-02 荣耀终端有限公司 一种图像处理方法及相关电子设备
CN116055699B (zh) * 2022-07-28 2023-10-20 荣耀终端有限公司 一种图像处理方法及相关电子设备

Similar Documents

Publication Publication Date Title
WO2020207239A1 (en) Method and apparatus for image processing
US10949958B2 (en) Fast fourier color constancy
US9996913B2 (en) Contrast based image fusion
US20070047803A1 (en) Image processing device with automatic white balance
CN111028190A (zh) 图像处理方法、装置、存储介质及电子设备
CN112565636B (zh) 图像处理方法、装置、设备和存储介质
WO2021143300A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2022067762A1 (zh) 图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质
US20120038800A1 (en) Method of image processing and image processing apparatus
CN105163047A (zh) 一种基于色彩空间转换的hdr图像生成方法、***及拍摄终端
CN112907497B (zh) 图像融合方法以及图像融合装置
WO2019019904A1 (zh) 白平衡处理方法、装置和终端
US20180025476A1 (en) Apparatus and method for processing image, and storage medium
US7885458B1 (en) Illuminant estimation using gamut mapping and scene classification
CN107682611B (zh) 对焦的方法、装置、计算机可读存储介质和电子设备
US11115637B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
EP3363193B1 (en) Device and method for reducing the set of exposure times for high dynamic range video imaging
WO2022067761A1 (zh) 图像处理方法、装置、拍摄设备、可移动平台及计算机可读存储介质
JP2007311895A (ja) 撮像装置、画像処理装置、画像処理方法及び画像処理プログラム
CN114286000B (zh) 图像色彩处理方法、装置和电子设备
JP2007293686A (ja) 撮像装置、画像処理装置、画像処理方法及び画像処理プログラム
JP2007221678A (ja) 撮像装置、画像処理装置、画像処理方法及び画像処理プログラム
CN109447925B (zh) 图像处理方法和装置、存储介质、电子设备
Brown Color processing for digital cameras
JP5050141B2 (ja) カラー画像の露出評価方法

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: 20955784

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: 20955784

Country of ref document: EP

Kind code of ref document: A1