WO2022126379A1 - 图像处理方法、装置及图像采集设备 - Google Patents

图像处理方法、装置及图像采集设备 Download PDF

Info

Publication number
WO2022126379A1
WO2022126379A1 PCT/CN2020/136545 CN2020136545W WO2022126379A1 WO 2022126379 A1 WO2022126379 A1 WO 2022126379A1 CN 2020136545 W CN2020136545 W CN 2020136545W WO 2022126379 A1 WO2022126379 A1 WO 2022126379A1
Authority
WO
WIPO (PCT)
Prior art keywords
white balance
image
target
balance parameter
environment
Prior art date
Application number
PCT/CN2020/136545
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/136545 priority Critical patent/WO2022126379A1/zh
Publication of WO2022126379A1 publication Critical patent/WO2022126379A1/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, and an image acquisition device.
  • the white balance parameters are usually pre-determined according to a preview image captured by the image capture device before capturing the target image.
  • the white balance parameter performs white balance correction on the target image. Since the preview image needs to reach a certain frame rate, such as at least 30 frames per second, the exposure time of each frame of the preview image is short. Therefore, in scenes with low ambient brightness, such as night scenes, the preview image may There is a lot of noise, and the white balance parameters determined based on the preview image may be inaccurate. After using the white balance parameters determined based on the preview image to correct the white balance of the target image, the target image will appear greenish, purple and other biased. The color problem affects the user experience.
  • the present application provides an image processing method, device and image acquisition device.
  • an image processing method comprising:
  • the target image is subjected to white balance correction using the target white balance parameter.
  • an image processing apparatus includes a processor, a memory, and a computer program stored in the memory for execution by the processor, the processor executing the computer
  • the program implements the following steps:
  • the target image is subjected to white balance correction using the target white balance parameter.
  • an image acquisition device includes a sensor and the image processing apparatus described in the second aspect above.
  • the brightness of the environment where the image capture device is currently located can be determined, and if the environment brightness is relatively dark, the target white balance parameter is determined based on the target image, and the The target white balance parameter performs white balance correction on the target image. Since the acquisition of the target image is not limited by the frame rate, the exposure time can be set to be longer. When the ambient brightness is low, the exposure time of the target image is usually longer than that of the preview image. The target white balance parameter is more accurate, which can reduce the color cast problem of the target image after white balance correction.
  • FIG. 1 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a white balance statistical region for determining a white point according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a processing chain of an image processing chip according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an image processing method according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a logical structure of an image processing apparatus according to an embodiment of the present application.
  • the same object will show different colors under the illumination of different light sources, and usually the human eye can perceive the color change of the object caused by the external light source, and judge the color of the object as its original color, that is, color constancy, for example, a A piece of white paper, which the human eye perceives as white in the sun, still considers it white in the light.
  • the image acquisition device does not have this feature.
  • the images of the same object collected under different light sources will show different colors.
  • the white balance correction is performed on the image collected by the acquisition device to eliminate the influence of the light source on the color of the object in the image.
  • the image capture device captures a preview image in real time and displays it on the display interface for the user to view.
  • the image capture device captures and stores the target image desired by the user. Since the scene corresponding to one or more frames of preview images collected before the target image is often very close to the scene corresponding to the target image, the white balance parameters can be predetermined according to the preview image, and after the target image is collected, the predetermined white balance parameters can be used.
  • the white balance parameter performs white balance correction on the target image. Since the preview image needs to reach a certain frame rate, the exposure time of each frame of the preview image is short.
  • the white balance parameters may be inaccurate. After using the white balance parameters determined based on the preview image to correct the white balance of the target image, it will cause the target image to appear green, purple and other color cast problems, which will seriously affect the user experience.
  • the present application provides an image processing method. After acquiring the target image currently collected by the image capture device, the brightness of the environment where the image capture device is currently located can be determined. If the environment brightness is relatively dark, the preview image is not directly used for determination.
  • the white balance parameter for performing white balance correction on the target image is determined based on the target image itself, and the white balance parameter is used to perform white balance correction on the target image. Since the exposure time of the preview image is shorter and the image noise is more when the ambient brightness is dark, the white balance parameter can be determined according to the target image whose exposure time is longer than that of the preview image, so as to obtain a more accurate white balance parameter for the target image.
  • the image is corrected to reduce the color cast of the target image after white balance correction.
  • the image processing method provided in the embodiment of the present application can be applied to an image acquisition device with an image acquisition function.
  • the image acquisition device may be a mobile phone, a camera, a tablet, a drone equipped with a camera, an unmanned vehicle, etc.
  • the acquisition device may include an image processing chip, and after the image is acquired, the image processing chip may be used to perform white balance correction on the image.
  • the image processing method provided by the embodiment of the present application can also be applied to a device without an image acquisition function, the device only has an image processing function, the device is connected in communication with the image acquisition device, can acquire the image acquired by the image acquisition device, and perform whitening Balance correction.
  • the preview image in the embodiment of the present application refers to an image that is captured by the image capture device in real time according to a certain frame rate after the user enables the photographing function of the image capture device, and displayed on the display interface of the image capture device for the user to preview.
  • the preview image does not will be stored in the image acquisition device. Since the preview image is a real-time image, it is generally required to be relatively smooth, so its frame rate needs to meet certain requirements, so its exposure time will be limited and generally shorter.
  • the target image in this embodiment of the present application may be the image collected by the image collection device after obtaining the image collection instruction input by the user. It is set to collect images at a certain time interval. When the image collected after the time interval set by the user is detected, after the target image is collected, it will be stored locally in the image collection device. Since the target image has no frame rate limitation, in scenes with low ambient brightness, the exposure time can generally be set to be longer.
  • the white balance parameters in the embodiments of the present application may be various types of parameters used to perform white balance correction on an image. Different white balance correction methods may be used, and the parameters may be different.
  • the white balance parameter can be the gain corresponding to the three color channels (R, G, B) of the image, and the brightness of the three color channels of the captured original image is multiplied by the corresponding gain, that is, the corrected white balance can be obtained. image.
  • FIG. 1 the image processing method provided by the embodiment of the present application is shown in FIG. 1 , and includes the following steps:
  • the brightness of the environment where the image capture device is currently located can be determined, wherein the brightness of the environment where the image capture device is currently located can be determined by the brightness of the target image, or can be combined with the brightness of the target image.
  • the brightness and the brightness of the preview image collected before the target image are determined, or determined in other ways, which are not limited in this embodiment of the present application.
  • the first preset brightness threshold can be a brightness threshold set based on experience or in combination with actual needs. If the brightness of the current environment is lower than the first preset brightness If the threshold is set, it is considered that the image acquisition device is in a dark scene at this time, and the white balance parameter determined by the preview image may be inaccurate at this time, and the effect of white balance correction on the target image is poor. Since the exposure time of the target image is not limited by the frame rate, it can be automatically adjusted according to the ambient brightness. Therefore, in a scene with low ambient brightness, the exposure time can be set larger, which is generally higher than the exposure time of the preview image. Therefore, at this time, a more accurate target white balance parameter can be determined based on the target image for performing white balance correction on the target image.
  • various white balance correction methods can be used, such as the maximum brightness method (Bright Surface First), the gray world method (Gray World), the improved gray world method, and the color gamut limit. method, light source prediction method, etc., which are not limited in the embodiments of the present application.
  • the target image can be corrected for white balance by using the target white balance parameter to obtain a corrected image.
  • the brightness of the current environment is first determined, and when the ambient brightness is low, the target white balance parameter for performing white balance correction on the target image is determined according to the target image, Because the exposure time of the target image is usually longer than that of the preview image when the ambient brightness is low, the target white balance parameter determined in combination with the target image is more accurate, and the color cast problem of the target image after white balance correction can be reduced.
  • the white balance parameter determined according to the preview image is also relatively accurate. Therefore, in this case, the second white balance parameter determined based on the target preview image can be directly used to perform white balance correction on the target image.
  • the target preview image may be one or more frames of preview images collected before the target image is collected. The time interval between these preview images and the target image collection is relatively short, and the corresponding scenes are usually relatively close to those corresponding to the target image. Therefore, The white balance parameters determined based on these preview images can be used to correct the target image.
  • the white balance parameter can be determined according to the target preview image. Therefore, as long as the current ambient brightness is determined to be higher than the first preset threshold, the pre-determined target preview image can be directly used.
  • the second white balance parameter performs white balance correction on the target image to improve the efficiency of image processing.
  • the second white balance parameter may be determined according to the preview image of the previous frame of the target image, or may be determined according to the preview images of multiple frames before the target image, and may be set according to actual requirements.
  • the target white balance parameter may be determined from the target image only for correcting the target image. Since the target image may also be abnormal during the acquisition process, the white balance parameters determined based on only one frame of target image may also be inaccurate, resulting in poor effect of the corrected target image. Therefore, in some embodiments, the first white balance parameter may be determined according to the target image, the second white balance parameter may be determined according to one or more frames of target preview images collected before the target image is collected, and then the first white balance parameter may be determined according to the first white balance parameter. and the second white balance parameter to determine the target white balance parameter.
  • the first white balance parameter may be directly determined as the target white balance parameter, or a certain fusion process may be performed on the first white balance parameter and the second white balance parameter to obtain the target white balance parameter.
  • the second white balance parameter determined in the preview image as a reference to determine the final target white balance parameter, the accuracy of the determined target white balance parameter can be improved.
  • the time interval between the target image and the target preview image collected by the image capture device is very small, so the difference in the environment where the image capture device is located when the two images are captured is often small. Therefore, it is possible to verify whether the target image is abnormal according to the difference in the environment where the image acquisition device is located when the two images are acquired, so as to verify whether the white balance parameter determined according to the target image is reliable.
  • the environment in which the image acquisition device collects two frames of images is very similar, the difference in the white balance parameters determined based on the two frames of images will not be too large.
  • the environmental difference between the first environment and the second environment may be determined first according to the first white balance parameter and the second white balance parameter, where the first environment is the environment where the image capture device is located when the target image is captured , the second environment is the environment where the image acquisition device is located when the target preview image is collected, and then the target white balance parameter can be determined according to the size of the environmental difference.
  • the white balance parameter usually corresponds to the light source type and color temperature in the environment, usually a type of light source has a corresponding white balance parameter and a certain color temperature within a certain range. Therefore, in some embodiments, when the environmental difference between the first environment and the second environment is determined according to the first white balance parameter and the second white balance parameter, the type of light source corresponding to the first environment may be determined first according to the first white balance parameter, That is, the first light source, and/or the color temperature corresponding to the first environment, that is, the first color temperature; and then determine the light source type corresponding to the second environment, that is, the second light source, and/or the color temperature corresponding to the second environment according to the second white balance parameter , the second color temperature. The environmental difference may then be determined according to the difference between the first light source and the second light source, and/or the difference between the first color temperature and the second color temperature.
  • the environmental difference is determined, whether the first white balance parameter determined based on the target image is reliable may be determined according to the magnitude of the environmental difference. For example, the environment difference determined according to the first white balance parameter and the second white balance parameter is small, indicating that the environment where the image acquisition device collects the target image and the preview image does not change much, which is in line with normal logic. Therefore, at this time, according to the target image The first white balance parameter determined by the image is relatively reliable. On the contrary, it is considered that the target image may be abnormal, and the first white balance parameter determined according to it may be unreliable. Therefore, in some embodiments, if the environmental difference between the first environment and the second environment meets the preset condition, the first white balance parameter is directly determined as the target white balance parameter.
  • the preset conditions may be various conditions for determining that the difference between the first environment and the second environment is relatively small.
  • the preset condition may be that the first light source and the second light source are the same, and if the types of the two light sources are the same, it means that there is little difference in the environment.
  • the preset condition may also be that the difference between the first color temperature and the second color temperature is smaller than the preset color temperature threshold. If the color temperature difference between the two environments is within a certain threshold range, it can be considered that the environment difference is not significant.
  • the preset condition may also meet the above two conditions at the same time, which may be set according to actual requirements.
  • the environmental difference if the environmental difference does not meet the preset conditions, it means that the environmental difference determined according to the first white balance parameter and the second white balance parameter is relatively large. At this time, the collected target image may be abnormal. The determined first white balance parameter may be inaccurate, and if the first white balance parameter is directly used to correct the target image, the effect may be poor. Therefore, in this case, the first white balance parameter and the second white balance parameter may be fused to obtain the target white balance parameter.
  • the fusion ratio when the first white balance parameter and the second white balance parameter are fused, the fusion ratio may be determined according to the first color temperature and the second color temperature.
  • the corresponding balance parameter may be determined according to the size of the color temperature.
  • the size of the fusion ratio, or the ratio of the two color temperatures can be directly used as the fusion ratio, which can be set according to actual needs.
  • the second white balance parameter can be determined according to the multi-frame preview images, so that the determined second white balance parameter more precise.
  • the brightness of the current environment may be determined in real time. If the current environment brightness value is greater than the second preset brightness threshold, it is considered that the current environment brightness value determined according to the target preview image at this time is considered.
  • the white balance parameter is relatively reliable.
  • the third white balance parameter can be determined and stored according to the target preview image of the current frame, and then weighted average processing is performed on the stored third white balance parameter within a period of time to obtain the second white balance parameter.
  • the weight corresponding to each third white balance parameter may be the same or different.
  • the weight of the third white balance parameter corresponding to the preview image with the shorter target image acquisition time interval may be set to be larger.
  • the third white balance parameter may be stored in the cache memory in a first-in, first-out storage manner, for example, may be stored in a queue, and the cache memory may be a FIFO memory, and its storage capacity may be preset, For example, the third white balance parameter of 10 frames or 5 frames of preview images can be stored. When the maximum storage capacity is reached, the earliest stored third balance parameter will be deleted, so as to ensure that the stored third white balance parameter is based on the target The image acquisition interval is determined by previewing images with shorter intervals.
  • the storage capacity of the cache memory can be dynamically adjusted. For example, when it is detected that the motion state of the image capture device changes greatly, it means that the scene corresponding to the preview image changes greatly. In this case, the storage capacity of the cache memory can be appropriately adjusted. When it is detected that the image capture device has been in a static state, the storage capacity of the cache memory can be appropriately increased.
  • the target image when determining the first white balance parameter according to the target image, may be divided into multiple image blocks first, and then the gains of the color channels (R, G, B) corresponding to the multiple image blocks are determined Then, a white image block is determined from a plurality of image blocks according to the gain value corresponding to each image block, and a first white balance parameter is determined according to the gain value of the white image block.
  • the target image can be divided into multiple image blocks, and each image block contains multiple pixels. For the pixels of each image block, the brightness values of the R channel of each image 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.
  • the gain values (ie, Rgain and Bgain) of each image block in the three color channels are determined, whether the block is a white image block can be determined according to the Rgain and Bgain of the image block. Specifically, it can be determined by using a preset white balance statistical area. As shown in Figure 2, it is a schematic diagram of a white balance statistical area. In this schematic diagram, the abscissa represents Rgain, the ordinate represents Bgain, and the gray part represents Statistical area, the statistical area characterizes the area that belongs to the white point.
  • each image block It can be determined whether the Rgain and Bgain of each image block fall within the statistical area, if it is in the statistical area, that is, the image block is a white image block, and if it is not in the statistical area, the block is not a white image block.
  • an Rgain value can be obtained according to the Rgain weighted average of the white image blocks, and a Bgain value can be obtained according to the Bgain weighted average of the white image blocks, thereby obtaining the first white balance parameter.
  • the target image may also be down-sampled first, and then the first white balance parameter is determined through the above steps.
  • the white balance parameter only a part of the image blocks of the target image may be selected for determining the white balance parameter, which may be set according to actual requirements.
  • the determination when determining the brightness of the environment where the image capturing device is currently located, the determination may be based on the brightness of each pixel in the image currently captured by the image capturing device. For example, when determining the brightness of the environment where the image acquisition device collects the target image, the method of photometry can be used to determine the brightness of each pixel in the target image. Current ambient brightness.
  • the image acquisition device may include an image processing chip, such as an ISP chip
  • the image processing chip may include a white balance module and other image processing modules
  • the other image processing modules may be a shadow correction module, a denoising module, an image enhancement module modules etc.
  • the white balance module can be used to determine the target white balance parameters of the target image, and then transmit the target white balance parameters to other image processing modules for use, so that other image processing modules can perform white balance correction on the target image according to the target white balance parameters , and perform image processing on the target image after white balance correction.
  • the processing link in the image processing chip is shown in Figure 3.
  • the white balance module can determine the white balance parameters based on the image, and then output to the processing modules such as the image processing module 3 and the image processing module 4 before and after the white balance module for processing (in the figure with 2 processing modules as an example).
  • the image processing module 1 or the image processing module 2 before the white balance module may need to use white balance parameters
  • the preview image can be processed through the processing link of the image processing chip to reach the white balance module
  • the white balance parameter can be determined according to the preview image
  • the white balance parameter determined in advance according to the preview image can be directly applied to each image processing module of the processing link (such as image processing module 1 -4).
  • the target image since the target image is used to determine the white balance parameter, the target white balance parameter has not yet been determined when passing through the image processing module 1 and the image processing module 2. Therefore, the target image needs to pass through image processing twice.
  • the processing link of the chip is processed.
  • the target white balance parameter can be determined.
  • the determined target white balance parameter Apply to other image processing modules in the processing chain to perform other image processing according to the target white balance parameter.
  • the image acquisition device includes a sensor and an ISP chip. After the sensor collects an image, it can perform a series of image processing such as dead pixel correction, shadow correction, white balance correction, denoising, and image enhancement through the ISP chip. Since the image acquisition device will collect the preview image after being turned on, the preview image can be displayed on the display interface of the image processing device after being processed by the processing link of the ISP chip for the user to preview. When the preview image passes through the white balance module in the ISP link, the white balance module can determine the white balance parameters according to the preview image. When the user presses the shooting button, after the image acquisition device collects the target image, it can The determined white balance parameters are applied to each module of the ISP chain to perform white balance correction and other various image processing on the target image. However, when the ambient brightness is low, the white balance parameter determined by using the preview image is inaccurate, resulting in color cast of the target image after white balance processing. Therefore, the embodiment of the present application provides a solution for white balance correction, as shown in FIG. 4 :
  • the image acquisition device After the image acquisition device is turned on, it will continuously collect preview images in real time, and each time a frame of preview image is collected, the brightness of the current environment can be determined according to the brightness of each pixel in the preview image (S401), and whether the brightness of the environment is greater than a preset threshold can be determined. (S402), if the ambient brightness is greater than the preset threshold, that is, determine the white balance parameter A according to the preview image (S403), then determine whether there is remaining storage space in the cache memory for storing the white balance parameter A (S404), if If there is remaining storage space, the white balance parameter A is stored in the cache memory (S405), if not, the earliest stored data is deleted (S406).
  • the storage capacity of the cache memory can be dynamically adjusted.
  • the image capture device After the user inputs the image capture instruction, the image capture device captures the target image.
  • the image capture device may determine the current ambient brightness according to the brightness of each pixel in the target image (S407), and determine whether the current ambient brightness is greater than the preset threshold (S408). ), if the ambient brightness is greater than the preset threshold, directly apply the white balance parameter A determined by the preview image of the previous frame to the processing link of the ISP chip, and perform white balance correction on the target image (S409).
  • the white balance parameters stored in the cache memory can also be weighted and averaged to obtain the white balance parameter B, which is applied to the processing link of the ISP chip to process the target image.
  • a white balance parameter C may be determined according to the target image, and then light source 1 and color temperature 1 may be determined according to the white balance parameter C (S4010).
  • weighted average processing is performed on the white balance parameter A stored in the current cache memory to obtain a white balance parameter B, and the light source 2 and the color temperature 2 are determined according to the white balance parameter B (S4011). Then, it is determined whether the light source 1 and the light source 2 are consistent, or whether the difference between the color temperature 1 and the color temperature 2 is smaller than a preset threshold (S4012).
  • the white balance parameter C is used to perform white balance correction on the target image (S4013). If the light source 1 and the light source 2 are inconsistent, or the difference between the color temperature 1 and the color temperature 2 is greater than the preset threshold, the white balance parameter B and the white balance parameter C can be used to obtain the white balance parameter D, and the white balance parameter D is used to perform the target image processing.
  • White balance correction (S4014).
  • the fusion ratio can be determined according to the ratio of color temperature 1 and color temperature 2. After the white balance parameter C or D is determined, the white balance parameter C or D can be applied to the processing link of the ISP chip to process the target image.
  • the target image needs to be processed through the processing link of the ISP chip twice, and the first time through the ISP link processing is used to determine the target used for calibration
  • the white balance parameter of the image is processed through the ISP link, which is used to apply the determined white balance parameter to each processing module of the ISP chip, so as to process the target image based on the determined white balance parameter.
  • an embodiment of the present application further provides an image processing apparatus.
  • the image processing apparatus 50 includes a processor 51 , a memory 52 , and the storage in the memory 52 can be executed by the processor 51 .
  • the computer program, the processor 51 implements the following steps when executing the computer program:
  • the target image is subjected to white balance correction using the target white balance parameter.
  • the processor when configured to determine a target white balance parameter based on the target image, it is specifically configured to:
  • the target white balance parameter is determined based on the first white balance parameter and the second white balance parameter.
  • the processor when the processor is configured to determine the target white balance parameter according to the first white balance parameter and the second white balance parameter, the processor is specifically configured to:
  • An environmental difference between a first environment and a second environment is determined based on the first white balance parameter and the second white balance parameter, where the first environment is the environment where the image capture device is located when the target image is captured, The second environment is the environment where the image capture device is located when the target preview image is captured;
  • the target white balance parameter is determined based on the environmental difference.
  • the processor when the processor is configured to determine the environmental difference between the first environment and the second environment based on the first white balance parameter and the second white balance parameter, the processor is specifically configured to:
  • a second light source and/or a second color temperature corresponding to the second environment is determined according to the second white balance parameter.
  • the environmental difference is determined according to the difference between the first light source and the second light source, and/or the difference between the first color temperature and the second color temperature.
  • the first white balance parameter is determined as the target white balance parameter.
  • the first white balance parameter and the second white balance parameter are fused to obtain the target white balance parameter.
  • the preset conditions include:
  • the first light source is identical to the second light source, and/or
  • the difference between the first color temperature and the second color temperature is less than a preset color temperature threshold.
  • the fusion ratio of the first white balance parameter and the second white balance parameter is determined based on the first color temperature and the second color temperature.
  • the processor when the processor is configured to determine the second white balance parameter based on the target preview image, it is specifically configured to:
  • a third white balance parameter is determined based on the target preview image and storage;
  • the third white balance parameter is stored in the cache memory in a first-in, first-out storage manner.
  • the storage capacity of the cache memory is adjustable.
  • the processor when the processor is configured to determine the first white balance parameter based on the target image, it is specifically configured to:
  • the first white balance parameter is determined according to the gain value of the white image block.
  • the processor is further configured to:
  • the target image is subjected to white balance correction by using the second white balance parameter.
  • the brightness of the environment in which the image acquisition device is located is determined based on brightness values of pixels in the target image.
  • the present application also provides an image acquisition device, the image acquisition device includes a sensor and the image processing apparatus described in any of the above embodiments.
  • an embodiment of the present specification further provides a computer storage medium, where a program is stored in the storage medium, and when the program is executed by a processor, the control method of the camera in any of the foregoing embodiments is implemented.
  • 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

一种图像处理方法、装置及图像采集设备。在获取到图像采集设备当前采集的目标图像后,可以判断图像采集设备当前所处环境的亮度,如果环境亮度比较暗,则基于目标图像确定目标白平衡参数,并利用该目标白平衡参数对目标图像进行白平衡校正。由于环境亮度较低时,目标图像的曝光时长通常大于预览图像的曝光时长,因而,结合目标图像确定的目标白平衡参数更准确,可以减少白平衡校正后的目标图像的偏色问题。

Description

图像处理方法、装置及图像采集设备 技术领域
本申请涉及图像处理技术领域,具体而言,涉及一种图像处理方法、装置及图像采集设备。
背景技术
目前,在对图像采集设备采集的目标图像进行白平衡校正时,通常是根据图像采集设备在采集目标图像之前采集的预览图像预先确定白平衡参数,在采集到目标图像后,可以根据预先确定的白平衡参数对目标图像进行白平衡校正。由于预览图像需要达到一定的帧率,比如每秒需采集至少30帧,从而每一帧预览图像的曝光时间较短,因此,在环境亮度较低的场景,比如夜景拍摄的场景,预览图像可能存在较多的噪声,基于预览图像确定的白平衡参数可能不太准确,在使用基于预览图像确定的白平衡参数对目标图像进行白平衡校正后,会导致目标图像出现偏绿、偏紫等偏色的问题,影响用户体验。
发明内容
有鉴于此,本申请提供一种图像处理方法、装置及图像采集设备。
根据本申请的第一方面,提供一种图像处理方法,所述方法包括:
获取图像采集设备当前采集的目标图像,所述目标图像在获取到用户的图像采集指令后采集;
当确定所述图像采集设备当前所处环境的亮度低于第一预设亮度阈值时,基于所述目标图像确定目标白平衡参数;
利用所述目标白平衡参数对所述目标图像进行白平衡校正。
根据本申请的第二方面,提供一种图像处理装置,所述图像处理装置包 括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
获取图像采集设备当前采集的目标图像,所述目标图像在获取到用户的图像采集指令后采集;
当确定所述图像采集设备当前所处环境的亮度低于第一预设亮度阈值时,基于所述目标图像确定目标白平衡参数;
利用所述目标白平衡参数对所述目标图像进行白平衡校正。
根据本申请的第三方面,提供一种图像采集设备,所述图像采集设备包括传感器和上述第二方面所述的图像处理装置。
应用本申请提供的方案,在获取到图像采集设备当前采集的目标图像后,可以判断图像采集设备当前所处环境的亮度,如果环境亮度比较暗,则基于目标图像确定目标白平衡参数,并利用该目标白平衡参数对目标图像进行白平衡校正。由于目标图像的采集不受帧率的限制,因而其曝光时长可以设置的较大,在环境亮度较低时,目标图像的曝光时长通常会大于预览图像的曝光时长,因而,结合目标图像确定的目标白平衡参数更准确,可以减少白平衡校正后的目标图像的偏色问题。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个实施例图像处理方法的流程图。
图2是本申请一个实施例的一种用于确定白点的白平衡统计区域示意图。
图3是本申请一个实施例的图像处理芯片的处理链路示意图。
图4是本申请一个实施例的图像处理方法的示意图。
图5是本申请一个实施例的图像处理装置的逻辑结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
同一物体在不同光源照射下会呈现出不同的颜色,而通常人眼可以感知由于外界光源引起的物体的颜色变化,并把物体的颜色判断为其原本的颜色,即颜色恒常性,比如,一张白纸,在阳光下人眼会认为其为白色,在灯光下还是认为其为白色。而图像采集设备并不具备这种特性,在不同光源下采集的同一物体的图像会呈现出不同的颜色,为了让图像采集设备可以和人眼一样,保持颜色恒常性的特性,通常需要对图像采装置采集的图像进行白平衡校正,以消除光源对图像中物体颜色的影响。
通常用户在使用图像采集设备采集图像时,图像采集设备会实时采集预览图像并在显示界面显示,以便用户查看。当用户输入图像采集指令后(即按下拍照按钮或控件),图像采集设备会采集用户想要的目标图像并存储。由于在目标图像之前采集的一帧或多帧预览图像对应的场景和目标图像对应的场景往往十分接近,因而可以根据预览图像预先确定白平衡参数,并在采集到目标图像后,利用预先确定的白平衡参数对目标图像进行白平衡校正。由于预览图像需要达到一定的帧率,从而每一帧预览图像的曝光时间较短,因此,在环境亮度较低的场景,比如夜景拍摄的场景,预览图像可能存在较多的噪声,基于预览图像确定的白平衡参数可能不太准确,在使用基于预览图像确定的白平衡参数对目标图像进行白平衡校正后,会导致目标图像出现偏绿、偏紫等偏色的问题,严重影响用户体验。
基于此,本申请提供一种图像处理方法,在获取到图像采集设备当前 采集的目标图像后,可以判断图像采集设备当前所处环境的亮度,如果环境亮度比较暗,则直接不采用预览图像确定对目标图像进行白平衡校正的白平衡参数,而是基于目标图像本身确定白平衡参数,并利用该白平衡参数对目标图像进行白平衡校正。由于在环境亮度较暗时,预览图像的曝光时长较短,图像噪声较多,因而可以根据曝光时长大于预览图像的曝光时长的目标图像确定白平衡参数,以得到更准确的白平衡参数对目标图像进行校正,减轻白平衡校正后的目标图像偏色的问题。
本申请实施例提供的图像处理方法可以应用于具有图像采集功能的图像采集设备,比如,该图像采集设备可以是手机、相机、平板、装有摄像头的无人机、无人车等,该图像采集设备可以包括图像处理芯片,在采集到图像后,可以利用图像处理芯片对图像进行白平衡校正。本申请施例提供的图像处理方法也可以应用于不具有图像采集功能的设备,该设备仅具有图像处理功能,该设备与图像采集设备通信连接,可以获取图像采集设备采集的图像,并进行白平衡校正。
本申请实施例中的预览图像是指用户开启图像采集设备的拍照功能后,图像采集设备按照一定的帧率实时采集,并在图像采集设备的显示界面显示以供用户预览的图像,预览图像不会存储在图像采集设备中。由于预览图像是实时图像,一般要求其比较流畅,所以其帧率需达到一定要求,因而其曝光时间会受到限制,一般会比较短。
本申请实施例中的目标图像可以是图像采集装置在获取到用户输入的图像采集指令采集到的图像,比如,可以是在检测到用户触发拍照的按钮或者控件后采集的图像,或者是用户预先设定按一定时间间隔采集图像,当检测到到达用户设定的时间间隔后采集的图像,采集到该目标图像后,会将其存储在图像采集设备本地。目标图像由于没有帧率的限制,因而,在环境亮度较低的场景,其曝光时间一般可以设置的比较长。
本申请实施例中的白平衡参数可以是用于对图像进行白平衡校正的各类参数,采用不同的白平衡校正方法,参数可能存在差异。比如,白平衡 参数可以是图像三个颜色通道(R、G、B)对应的增益,将采集的原始图像三个颜色通道的亮度分别与对应的增益相乘,即可以得到白平衡校正后的图像。
具体的,本申请实施例提供的图像处理方法如图1所示,包括以下步骤:
S102、获取图像采集设备当前采集的目标图像,所述目标图像在获取到用户的图像采集指令后采集;
S104、当确定所述图像采集设备当前所处环境的亮度低于第一预设亮度阈值时,基于所述目标图像确定目标白平衡参数;
S106、利用所述目标白平衡参数对所述目标图像进行白平衡校正。
在获取到图像采集设备当前采集的目标图像后,可以确定图像采集设备当前所处环境的亮度,其中,图像采集设备当前所处环境的亮度可以通过目标图像的亮度确定,也可以结合目标图像的亮度以及在目标图像之前采集的预览图像的亮度确定,或者通过其他方式确定,本申请实施例不作限制。
在确定当前环境的亮度后,可以与第一预设亮度阈值比较,第一预设亮度阈值可以是根据经验或者结合实际需求设定的亮度阈值,如果当前环境的亮度低于第一预设亮度阈值,则认为此时图像采集设备处于亮度较暗的场景,此时通过预览图像确定的白平衡参数可能不太准确,用于对目标图像进行白平衡校正的效果较差。而目标图像的曝光时间由于不受帧率的限制,其可以根据环境亮度自动调节,因而在环境亮度较低的场景,其曝光时间可以设置的较大,一般会高于预览图像的曝光时长,所以,此时可以基于目标图像去确定更加准确的目标白平衡参数,用于对目标图像进行白平衡校正。
其中,根据目标图像确定目标白平衡参数时,可以采用各种白平衡校正方法,比如最大亮度法(Bright Surface First)、灰度世界法(Gray World)、改进的灰度世界法、色域界限法、光源预测法等,本申请实施例不作限制。在根据目标图像确定白平衡参数后,即可以利用目标白平衡参数对目标图像进行白平衡校正,得到校正后的图像。
本申请实施例在获取图像采集设备当前采集的目标图像后,先判定当前环境的亮度,在环境亮度较低时,则根据目标图像确定用于对目标图像进行白平衡校正的目标白平衡参数,由于在环境亮度较低时,目标图像的曝光时长通常大于预览图像的曝光时长,因而,结合目标图像确定的目标白平衡参数更准确,可以减少白平衡校正后的目标图像的偏色问题。
在一些实施例,如果判定当前环境亮度高于第一预设亮度阈值,可以认为图像采集设备此时处于较亮的环境,因而根据预览图像确定的白平衡参数也是比较准确的。所以,这种情况下可以直接使用基于目标预览图像确定的第二白平衡参数对目标图像进行白平衡校正。其中,目标预览图像可以是在采集目标图像之前采集的一帧或者多帧预览图像,这些预览图像和目标图像采集的时间间隔较短,其对应的场景与目标图像对应的场景通常比较接近,因而基于这些预览图像确定的白平衡参数可以用于对目标图像进行校正。图像采集设备每采集一帧目标预览图像后,都可以根据目标预览图像确定出白平衡参数,因而,只要判定当前环境亮度高于第一预设阈值,则可以直接使用预先通过目标预览图像确定的第二白平衡参数对目标图像进行白平衡校正,提高图像处理的效率。第二白平衡参数可以根据目标图像的前一帧预览图像确定,也可以根据目标图像之前的多帧预览图像确定,可以根据实际需求设置。
在一些实施例中,可以仅根据目标图像确定目标白平衡参数,用于校正目标图像。由于目标图像在采集过程中也可能存在异常,仅根据一帧目标图像确定的白平衡参数也可能存在不准确的问题,导致校正后的目标图像效果较差。所以,在一些实施例中,可以先根据目标图像确定第一白平衡参数,再根据采集目标图像之前采集的一帧或多帧目标预览图像确定第二白平衡参数,然后根据第一白平衡参数和第二白平衡参数确定目标白平衡参数。比如,可以直接将第一白平衡参数确定为目标白平衡参数,也可以对第一白平衡参数和第二白平衡参数进行一定的融合处理,得到目标白平衡参数。通过采用预览图像确定的第二白平衡参数作参考,以确定最终的目标白平衡参数,可 以提高确定的目标白平衡参数的准确性。
一般情况下,图像采集设备采集目标图像和目标预览图像的时间间隔很小,因而,采集两种图像时图像采集设备所处环境差异也往往较小。因而,可以根据采集两种图像时图像采集设备所处环境的差异验证目标图像是否存在异常,以验证根据目标图像确定的白平衡参数是否可靠。通常如果图像采集设备采集两帧图像时,其所处环境很相似,那么基于这两帧图像确定的白平衡参数差异也不会太大。所以,在一些实施例,可以先根据第一白平衡参数和第二白平衡参数确定第一环境与第二环境的环境差异,其中,第一环境为采集目标图像时图像采集设备所处的环境,第二环境为采集目标预览图像时图像采集设备所处的环境,然后可以根据环境差异的大小确定目标白平衡参数。
由于白平衡参数通常与环境中的光源类型和色温相对应,通常一类光源,其对应的白平衡参数在一定范围、色温也在一定范围。所以,在一些实施例中,在根据第一白平衡参数和第二白平衡参数确定第一环境与第二环境的环境差异时,可以先根据第一白平衡参数确定第一环境对应光源类型,即第一光源,和/或第一环境对应的色温,即第一色温;然后根据第二白平衡参数确定第二环境对应的光源类型,即第二光源,和/或第二环境对应的色温,即第二色温。然后可以根据第一光源与第二光源的差异,和/或所述第一色温与所述第二色温的差异确定环境差异。
在确定环境差异后,可以根据环境差异的大小确定基于目标图像确定的第一白平衡参数是否可靠。比如,根据第一白平衡参数和第二白平衡参数确定的环境差异较小,说明图像采集设备采集目标图像和采集预览图像所处环境变化不大,符合正常的逻辑,因而,此时根据目标图像确定的第一白平衡参数比较可靠。反之,则认为目标图像可能存在异常,根据其确定的第一白平衡参数可能不太可靠。所以,在一些实施例中,如果第一环境和第二环境的环境差异符合预设条件,则直接将第一白平衡参数确定为目标白平衡参数。
其中,预设条件可以是用于判定第一环境和第二环境之间的差异比较小 的各种条件。比如,在一些实施例中,预设条件可以是第一光源和第二光源一致,如果两个光源类型一致,则说明环境差异不大。当然,预设条件也可以是第一色温和第二色温的差异小于预设色温阈值,如果两种环境的色温差异在一定阈值范围,也可以认为环境差异不大。当然,在一些实施例中,预设条件也可以是同时符合上述两种条件,具体可以根据实际需求设置。
在一些实施例中,如果环境差异不符预设条件,即说明根据第一白平衡参数和第二白平衡参数确定的环境差异比较大,这时,采集的目标图像可能存在异常,因而根据目标图像确定的第一白平衡参数可能不准确,如果直接使用第一白平衡参数校正目标图像,可能效果较差。因此,在这种情况下,可以将第一白平衡参数和第二白平衡参数进行融合,得到目标白平衡参数。
在一些实施例中,第一白平衡参数和第二白平衡参数在进行融合时,其融合的比例可以根据第一色温和第二色温确定,比如,可以依据色温的大小确定各平衡参数对应的融合比例的大小,或者可以直接将两个色温的比例作为融合比例,具体可以根据实际需设置。
由于预览图像是实时采集的,通常连续一段时间内采集的多帧预览图像其对应的场景都比较相似,所以,可以根据多帧预览图像确定第二白平衡参数,以便确定的第二白平衡参数更加准确。在一些实施例中,在图像采集设备采集目标预览图像的过程中,可以实时地确定当前环境的亮度,如果当前环境亮度值大于第二预设亮度阈值,则认为此时根据目标预览图像确定的白平衡参数比较可靠,因而,可以根据当前一帧目标预览图像确定第三白平衡参数并存储,然后对存储的一段时间内的第三白平衡参数进行加权平均处理,得到第二白平衡参数。其中,各第三白平衡参数对应的权重可以一样,也可以不同,比如,与目标图像采集时间间隔越短的预览图像对应的第三白平衡参数的权重可以设置的越大。
由于时间间隔较长的预览图像其对应的场景可能和目标图像对应的场景差别较大,所以在计算第二白平衡参数时,应尽量选取和目标图像场景较为相似的预览图像来确定,预览图像采集时间应尽可能与目标图像的采集时间 比较接近。所以,在一些实施例中,第三白平衡参数可以采用先进先出的存储方式存储在缓存存储器中,比如,可以以队列的方式存储,缓存存储器可以是FIFO存储器,其存储容量可以预先设置,比如可以存储10帧或者5帧预览图像的第三白衡参数,当达到最大存储容量时,则将最早存储的第三平衡参数删除,这样可以保证存储的第三白平衡参数都是根据与目标图像采集时间间隔较短的预览图像确定的。
在一些实施例中,缓存存储器的存储容量可以动态调节,比如,当检测到图像采集设备运动状态变化较大,则说明预览图像对应的场景变化比较大,这时可以适当将缓存存储器的存储容量减小,当检测到图像采集设备一直处于静止状态,则可以适当增大缓存存储器的存储容量。
在一些实施例中,在根据目标图像确定第一白平衡参数时,可以先将目标图像划分成多个图像块,然后确定这多个图像块对应的色彩通道(R、G、B)的增益值,然后根据各图像块对应的增益值从多个图像块中确定白色图像块,并根据白色图像块的增益值确定第一白平衡参数。举个例子,可以将目标图像划分成多个图像块,每个图像块包含有多个像素点。针对每个图像块的像素点,将每个图像块的R通道的亮度值进行累加求平均值,G通道的亮度值进行累加求平均值,B通道的亮度值进行累加求平均值。然后,可以将G通道的平均值Gavg除以R通道的平均值Ravg得到R通道的灰度增益值Rgain(即Rgain=Gavg/Ravg),G通道的平均值Gavg除以B通道的平均值Bavg得到B通道的灰度增益值Bgain(即Bgain=Gavg/Bavg),将G通道的灰度增益值设为1。或者,也可以利用下述公式计算增益值:Rgain=Ravg/Gavg,Bgain=Bavg/Gavg。
在确定各图像块在三个色彩通道的增益值(即Rgain和Bgain)后,可以根据图像块的Rgain和Bgain来确定这个块是不是白色图像块。具体的,可以利用预先设定的白平衡统计区域来确定,如图2所示,是一种白平衡统计区域的示意图,在该示意图中,横坐标表示Rgain,纵坐标表示Bgain,灰色部分表示统计区域,统计区域表征属于白点的区域。可以判定判断每个图像块 的Rgain和Bgain是否落入统计区域内,若在统计区域内,即该图像块为白色图像块,不在该统计区域内则该块不是白色图像块。
确定目标图像中的白色图像块后,可以根据白色图像块的Rgain加权平均得到一个Rgain值,根据白色图像块的Bgain加权平均得到一个Bgain值,从而得到第一白平衡参数。
当然,在根据目标图像确定第一白平衡参数时,为了提高处理效率,也可以先对目标图像进行下采样处理,再通过上述步骤确定第一白平衡参数。或者也可以只选目标图像的一部分图像块用于确定白平衡参数,具体可以根据实际需求设置。
当然,在根据目标预览图像确定第三平衡参数时,也可以采用上述方法,在此不再赘述。
在一些实施例中,在确定图像采集设备当前所处环境的亮度时,可以根据图像采集设备当前采集的图像中各像素点的亮度确定。比如,在确定图像采集设备采集目标图像所处环境的亮度时,可以采用测光的方式确定,可以先统计目标图像中各像素点的亮度,然后可以通过点测光、局部测光等方式确定当前环境亮度。
在一些实施例中,图像采集设备中可以包括图像处理芯片,比如ISP芯片,图像处理芯片可以包括白平衡模块和其他图像处理模块,其他图像处理模块可以是阴影矫正模块、去噪模块、图像增强模块等。其中,白平衡模块可以用于确定目标图像的目标白平衡参数,然后将目标白平衡参数传输给其他图像处理模块使用,以便其他图像处理模块根据目标白平衡参数对所述目标图像进行白平衡校正,并对白平衡校正后的目标图像进行图像处理。在一些场景,图像处理芯片中的处理链路如图3所示,传感器采集到图像后,需要先经过图像处理模块1、图像处理模块2等处理模块进行处理(图中以2个处理模块为例),然后再输出给白平衡模块,白平衡模块可以基于图像确定白平衡参数,然后再输出给白平衡模块之前后的图像处理模块3和图像处理模块4等处理模块进行处理(图中以2个处理模块为例)。由于在白平衡模块之 前的图像处理模块1或图像处理模块2可能需要使用白平衡参数,由于预览图像在目标图像之前采集,预览图像可以先经过图像处理芯片的处理链路进行处理,到达白平衡模块时,即可以确定根据预览图像确定白平衡参数,当采集到目标图像后,即可以直接将预先根据预览图像确定的白平衡参数应用到处理链路的各个图像处理模块(比如图像处理模块1-4)中。本申请实施例中,由于是采用目标图像确定白平衡参数,因此,在经过图像处理模块1和图像处理模块2时,还未确定出目标白平衡参数,所以,目标图像需两次通过图像处理芯片的处理链路进行处理,第一次经过图像处理芯片的处理链路时,可以确定出目标白平衡参数,第二次经过图像处理芯片的处理链路时,则将确定的目标白平衡参数应用到处理链路中的其他图像处理模块,以根据该目标白平衡参数进行其他的图像处理。
为了进一步解释本申请实施例提供的图像处理方法,以下结合一个具体的实施例加以介绍。
图像采集设备包括传感器和ISP芯片,传感器采集到图像后可以经过ISP芯片进行坏点校正、阴影校正、白平衡校正、去噪、图像增强等一系列图像处理。由于图像采集设备在开启后,会采集预览图像,预览图像在通过ISP芯片的处理链路处理后,即可以显示在图像处理装置的显示界面,供用户预览。预览图像在经过ISP链路中的白平衡模块时,白平衡模块可以根据预览图像确定白平衡参数,当用户按下拍摄按钮时,图像采集设备采集到目标图像后,即可以将预先根据预览图像确定的白平衡参数应用到ISP链路的各个模块中,以对目标图像进行白平衡校正和其他各种图像处理。但是,当环境亮度较低时,采用预览图像确定的白平衡参数不准确,造成白平衡处理后的目标图像偏色。所以,本申请实施例提供了一种白平衡校正的方案,具体如图4所示:
图像采集设备在开启后,会实时连续地采集预览图像后,每采集一帧预览图像,可以根据预览图像中各像素点的亮度确定当前环境的亮度(S401),判断环境亮度是否大于预设阈值(S402),如果环境亮度大于预设阈值,即根据 该预览图像确定白平衡参数A(S403),然后判断用于存储白平衡参数A的缓存存储器的是否还有剩余存储空间(S404),如果还有剩余存储空间,则将白平衡参数A存储至缓存存储器内(S405),如果没有,则删除最早存入的数据(S406)。其中,缓存存储器的存储容量可以动态调节。当用户输入图像采集指令后,图像采集设备采集目标图像,此时,图像采集设备可以根据目标图像中个像素点的亮度确定当前环境亮度(S407),判断当前环境亮度是否大于预设阈值(S408),如果环境亮度大于预设阈值,则直接将上一帧预览图像确定白平衡参数A应用到ISP芯片的处理链路中,对目标图像进行白平衡校正(S409)。当然,也可以对缓存存储器中存储的白平衡参数做加权平均处理,得到白平衡参数B,应用到ISP芯片的处理链路中,对目标图像进行处理。如果当前环境亮度低于预设阈值,则可以根据目标图像确定一个白平衡参数C,然后根据白平衡参数C确定光源1和色温1(S4010)。同时对当前缓存存储器中存储的白平衡参数A做加权平均处理,得到白平衡参数B,根据白平衡参数B确定光源2和色温2(S4011)。然后判断光源1和光源2是否一致,或者色温1和色温2的差值是否小于预设阈值(S4012)。如果光源1和光源2一致,或者色温1和色温2的差值小于预设阈值,则采用白平衡参数C对目标图像进行白平衡校正(S4013)。如果光源1和光源2不一致,或者色温1和色温2的差值大于预设阈值,则可以采用白平衡参数B和白平衡参数C融合得到白平衡参数D,利用白平衡参数D对目标图像进行白平衡校正(S4014)。其中,融合比例可以根据色温1和色温2的比例确定。在确定白平衡参数C或D后,则可以将白平衡参数C或D应用到ISP芯片处理链路当中,对目标图像进行处理。由于在环境亮度较低时,需根据目标图像本身确定白平衡参数,所以,目标图像需两次经过ISP芯片的处理链路进行处理,第一次通过ISP链路处理用于确定用于校正目标图像的白平衡参数,第二通过ISP链路处理,则用于将确定的白平衡参数应用到ISP芯片的各处理模块,以对基于确定的白平衡参数对目标图像进行处理。
相应地,本申请实施例还提供了一种图像处理装置,如图5所示,所述 图像处理装置50包括处理器51、存储器52、存储于所述存储器52可供所述处理器51执行的计算机程序,所述处理器51执行所述计算机程序时实现以下步骤:
获取图像采集设备当前采集的目标图像,所述目标图像在接收到用户的图像采集指令后采集;
当确定所述图像采集设备当前所处环境的亮度低于第一预设亮度阈值时,基于所述目标图像确定目标白平衡参数;
利用所述目标白平衡参数对所述目标图像进行白平衡校正。
在一些实施例中,所述处理器用于基于所述目标图像确定目标白平衡参数时,具体用于:
基于所述目标图像确定第一白平衡参数;
基于目标预览图像确定第二白平衡参数,所述目标预览图像为采集所述目标图像之前采集的一帧或多帧预览图像;
基于所述第一白平衡参数和所述第二白平衡参数确定所述目标白平衡参数。
在一些实施例中,所述处理器用于根据所述第一白平衡参数和所述第二白平衡参数确定所述目标白平衡参数时,具体用于:
基于所述第一白平衡参数和所述第二白平衡参数确定第一环境与第二环境的环境差异,所述第一环境为采集所述目标图像时所述图像采集设备所处的环境,所述第二环境为采集所述目标预览图像时所述图像采集设备所处的环境;
基于所述环境差异确定所述目标白平衡参数。
在一些实施例中,所述处理器用于基于所述第一白平衡参数和所述第二白平衡参数确定第一环境与第二环境的环境差异时,具体用于:
根据所述第一白平衡参数确定所述第一环境对应的第一光源和/或第一色温;
根据所述第二白平衡参数确定所述第二环境对应的第二光源和/或第二色 温。
根据所述第一光源与所述第二光源的差异,和/或所述第一色温与所述第二色温的差异确定所述环境差异。
在一些实施例中,若所述环境差异符合预设条件,则将所述第一白平衡参数确定为所述目标白平衡参数。
在一些实施例中,若所述环境差异不符合预设条件,则对所述第一白平衡参数和所述第二白平衡参数进行融合,得到所述目标白平衡参数。
在一些实施例中,所述预设条件包括:
所述第一光源与所述第二光源一致,和/或
所述第一色温与所述第二色温的差异小于预设色温阈值。
在一些实施例中,所述第一白平衡参数和所述第二白平衡参数的融合比例基于所述第一色温和所述第二色温确定。
在一些实施例中,所述处理器用于基于目标预览图像确定第二白平衡参数时,具体用于:
在采集目标预览图像的过程中,当确定采集所述目标预览图像时所述图像采集设备所处环境的亮度大于第二预设亮度阈值,则基于所述目标预览图像确定第三白平衡参数并存储;
对存储的所述第三白平衡参数进行加权平均处理,得到所述第二白平衡参数。
在一些实施例中,所述第三白平衡参数采用先进先出的存储方式存储在缓存存储器中。
在一些实施例中,所述缓存存储器的存储容量可调。
在一些实施例中,所述处理器用于基于所述目标图像确定第一白平衡参数时,具体用于:
确定所述目标图像中多个图像块对应的色彩通道的增益值;
基于所述增益值从所述多个图像块中确定白色图像块;
根据所述白色图像块的所述增益值确定所述第一白平衡参数。
在一些实施例中,所述处理器还用于:
当确定所述图像采集设备所处环境的亮度低于所述第一预设亮度阈值时,利用所述第二白平衡参数对所述目标图像进行白平衡校正。
在一些实施例中,所述图像采集设备所处环境的亮度基于所述目标图像中像素点的亮度值确定。
其中,图像处理装置用于对图像进行白平衡处理的具体实施细节可参考上述图像处理方法中各实施的描述,在此不再赘述。
进一步地,本申请还提供一种图像采集设备,所述图像采集设备包括传感器和上述任一实施例中所述的图像处理装置。
相应地,本说明书实施例还提供一种计算机存储介质,所述存储介质中存储有程序,所述程序被处理器执行时实现上述任一实施例中的相机的控制方法。
本说明书实施例可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机可用存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括但不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一 个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上对本发明实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (30)

  1. 一种图像处理方法,其特征在于,所述方法包括:
    获取图像采集设备当前采集的目标图像,所述目标图像在接收到用户的图像采集指令后采集;
    当确定所述图像采集设备当前所处环境的亮度低于第一预设亮度阈值时,基于所述目标图像确定目标白平衡参数;
    利用所述目标白平衡参数对所述目标图像进行白平衡校正。
  2. 根据权利要求1所述的方法,其特在于,基于所述目标图像确定目标白平衡参数,包括:
    基于所述目标图像确定第一白平衡参数;
    基于目标预览图像确定第二白平衡参数,所述目标预览图像为采集所述目标图像之前采集的一帧或多帧预览图像;
    基于所述第一白平衡参数和所述第二白平衡参数确定所述目标白平衡参数。
  3. 根据权利要求2所述的方法,其特在于,根据所述第一白平衡参数和所述第二白平衡参数确定所述目标白平衡参数,包括:
    基于所述第一白平衡参数和所述第二白平衡参数确定第一环境与第二环境的环境差异,所述第一环境为采集所述目标图像时所述图像采集设备所处的环境,所述第二环境为采集所述目标预览图像时所述图像采集设备所处的环境;
    基于所述环境差异确定所述目标白平衡参数。
  4. 根据权利要求3所述的方法,其特在于,基于所述第一白平衡参数和所述第二白平衡参数确定第一环境与第二环境的环境差异,包括:
    根据所述第一白平衡参数确定所述第一环境对应的第一光源和/或第一色温;
    根据所述第二白平衡参数确定所述第二环境对应的第二光源和/或第二色温。
    根据所述第一光源与所述第二光源的差异,和/或所述第一色温与所述第二色温的差异确定所述环境差异。
  5. 根据权利要求4所述的方法,其特在于,若所述环境差异符合预设条件,则将所述第一白平衡参数确定为所述目标白平衡参数。
  6. 根据权利要求4或5所述的方法,其特在于,若所述环境差异不符合预设条件,则对所述第一白平衡参数和所述第二白平衡参数进行融合,得到所述目标白平衡参数。
  7. 根据权利要求5或6所述的方法,其特在于,所述预设条件包括:
    所述第一光源与所述第二光源一致,和/或
    所述第一色温与所述第二色温的差异小于预设色温阈值。
  8. 根据权利要求6所述的方法,其特在于,所述第一白平衡参数和所述第二白平衡参数的融合比例基于所述第一色温和所述第二色温确定。
  9. 根据权利要求2-8任一项所述的方法,其特在于,基于目标预览图像确定第二白平衡参数,包括:
    在采集目标预览图像的过程中,当确定采集所述目标预览图像时所述图像采集设备所处环境的亮度大于第二预设亮度阈值,则基于所述目标预览图像确定第三白平衡参数并存储;
    对存储的所述第三白平衡参数进行加权平均处理,得到所述第二白平衡参数。
  10. 根据权利要求9所述的方法,其特在于,所述第三白平衡参数采用先进先出的存储方式存储在缓存存储器中。
  11. 根据权利要求10所述的方法,其特在于,所述缓存存储器的存储容量可调。
  12. 根据权利要求2-11任一项所述的方法,其特在于,基于所述目标图像确定第一白平衡参数,包括:
    确定所述目标图像中多个图像块对应的色彩通道的增益值;
    基于所述增益值从所述多个图像块中确定白色图像块;
    根据所述白色图像块的所述增益值确定所述第一白平衡参数。
  13. 根据权利要求2所述的方法,其特在于,所述方法还包括:
    当确定所述图像采集设备所处环境的亮度低于所述第一预设亮度阈值时,利用所述第二白平衡参数对所述目标图像进行白平衡校正。
  14. 根据权利要求1所述的方法,其特在于,所述图像采集设备所处环境的亮度基于所述目标图像中像素点的亮度值确定。
  15. 根据权利要求1所述的方法,其特在于,所述图像采集设备包括图像处理芯片,所述图像处理芯片包括白平衡模块和其他图像处理模块,所述白平衡模块用于基于所述目标图像确定所述目标白平衡参数,并将所述目标白平衡参数传输给所述其他图像处理模块,以使所述其他图像处理模块利用所述目标白平衡参数对所述目标图像进行白平衡校正,并对白平衡校正后的目标图像进行图像处理。
  16. 一种图像处理装置,其特征在于,所述图像处理装置包括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
    获取图像采集设备当前采集的目标图像,所述目标图像在接收到用户的图像采集指令后采集;
    当确定所述图像采集设备当前所处环境的亮度低于第一预设亮度阈值时,基于所述目标图像确定目标白平衡参数;
    利用所述目标白平衡参数对所述目标图像进行白平衡校正。
  17. 根据权利要求16所述的装置,其特在于,所述处理器用于基于所述目标图像确定目标白平衡参数时,具体用于:
    基于所述目标图像确定第一白平衡参数;
    基于目标预览图像确定第二白平衡参数,所述目标预览图像为采集所述目标图像之前采集的一帧或多帧预览图像;
    基于所述第一白平衡参数和所述第二白平衡参数确定所述目标白平衡参数。
  18. 根据权利要求17所述的装置,其特在于,所述处理器用于根据所述第一白平衡参数和所述第二白平衡参数确定所述目标白平衡参数时,具体用于:
    基于所述第一白平衡参数和所述第二白平衡参数确定第一环境与第二环境的环境差异,所述第一环境为采集所述目标图像时所述图像采集设备所处的环境,所述第二环境为采集所述目标预览图像时所述图像采集设备所处的环境;
    基于所述环境差异确定所述目标白平衡参数。
  19. 根据权利要求18所述的装置,其特在于,所述处理器用于基于所述第一白平衡参数和所述第二白平衡参数确定第一环境与第二环境的环境差异时,具体用于:
    根据所述第一白平衡参数确定所述第一环境对应的第一光源和/或第一色温;
    根据所述第二白平衡参数确定所述第二环境对应的第二光源和/或第二色温。
    根据所述第一光源与所述第二光源的差异,和/或所述第一色温与所述第二色温的差异确定所述环境差异。
  20. 根据权利要求18所述的装置,其特在于,若所述环境差异符合预设条件,则将所述第一白平衡参数确定为所述目标白平衡参数。
  21. 根据权利要求19或20所述的装置,其特在于,若所述环境差异不符合预设条件,则对所述第一白平衡参数和所述第二白平衡参数进行融合,得到所述目标白平衡参数。
  22. 根据权利要求20或21所述的装置,其特在于,所述预设条件包括:
    所述第一光源与所述第二光源一致,和/或
    所述第一色温与所述第二色温的差异小于预设色温阈值。
  23. 根据权利要求22所述的装置,其特在于,所述第一白平衡参数和所述第二白平衡参数的融合比例基于所述第一色温和所述第二色温确定。
  24. 根据权利要求17-23任一项所述的装置,其特在于,所述处理器用于基于目标预览图像确定第二白平衡参数时,具体用于:
    在采集目标预览图像的过程中,当确定采集所述目标预览图像时所述图像采集设备所处环境的亮度大于第二预设亮度阈值,则基于所述目标预览图像确定第三白平衡参数并存储;
    对存储的所述第三白平衡参数进行加权平均处理,得到所述第二白平衡参数。
  25. 根据权利要求24所述的装置,其特在于,所述第三白平衡参数采用先进先出的存储方式存储在缓存存储器中。
  26. 根据权利要求25所述的装置,其特在于,所述缓存存储器的存储容量可调。
  27. 根据权利要求17-26任一项所述的装置,其特在于,所述处理器用于基于所述目标图像确定第一白平衡参数时,具体用于:
    确定所述目标图像中多个图像块对应的色彩通道的增益值;
    基于所述增益值从所述多个图像块中确定白色图像块;
    根据所述白色图像块的所述增益值确定所述第一白平衡参数。
  28. 根据权利要求17所述的装置,其特在于,所述处理器还用于:
    当确定所述图像采集设备所处环境的亮度低于所述第一预设亮度阈值时,利用所述第二白平衡参数对所述目标图像进行白平衡校正。
  29. 根据权利要求17所述的装置,其特在于,所述图像采集设备所处环境的亮度基于所述目标图像中像素点的亮度值确定。
  30. 一种图像采集设备,其特征在于,所述图像采集设备包括传感器和权利要求17-29任一项所述的图像处理装置。
PCT/CN2020/136545 2020-12-15 2020-12-15 图像处理方法、装置及图像采集设备 WO2022126379A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/136545 WO2022126379A1 (zh) 2020-12-15 2020-12-15 图像处理方法、装置及图像采集设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/136545 WO2022126379A1 (zh) 2020-12-15 2020-12-15 图像处理方法、装置及图像采集设备

Publications (1)

Publication Number Publication Date
WO2022126379A1 true WO2022126379A1 (zh) 2022-06-23

Family

ID=82059870

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/136545 WO2022126379A1 (zh) 2020-12-15 2020-12-15 图像处理方法、装置及图像采集设备

Country Status (1)

Country Link
WO (1) WO2022126379A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004349930A (ja) * 2003-05-21 2004-12-09 Fuji Photo Film Co Ltd デジタルカメラ
CN108093233A (zh) * 2017-12-28 2018-05-29 努比亚技术有限公司 一种图像处理方法、终端及计算机可读存储介质
CN108174172A (zh) * 2017-12-25 2018-06-15 广东欧珀移动通信有限公司 拍摄方法及装置、计算机可读存储介质和计算机设备
CN109151426A (zh) * 2017-06-28 2019-01-04 杭州海康威视数字技术股份有限公司 一种白平衡调整方法、装置、相机及介质
CN109462745A (zh) * 2018-12-29 2019-03-12 维沃移动通信有限公司 一种白平衡处理方法及移动终端
CN110602473A (zh) * 2019-10-24 2019-12-20 维沃移动通信有限公司 一种白平衡校准方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004349930A (ja) * 2003-05-21 2004-12-09 Fuji Photo Film Co Ltd デジタルカメラ
CN109151426A (zh) * 2017-06-28 2019-01-04 杭州海康威视数字技术股份有限公司 一种白平衡调整方法、装置、相机及介质
CN108174172A (zh) * 2017-12-25 2018-06-15 广东欧珀移动通信有限公司 拍摄方法及装置、计算机可读存储介质和计算机设备
CN108093233A (zh) * 2017-12-28 2018-05-29 努比亚技术有限公司 一种图像处理方法、终端及计算机可读存储介质
CN109462745A (zh) * 2018-12-29 2019-03-12 维沃移动通信有限公司 一种白平衡处理方法及移动终端
CN110602473A (zh) * 2019-10-24 2019-12-20 维沃移动通信有限公司 一种白平衡校准方法及装置

Similar Documents

Publication Publication Date Title
AU2019326496B2 (en) Method for capturing images at night, apparatus, electronic device, and storage medium
EP3694203B1 (en) Method and device for obtaining exposure compensation value of high-dynamic-range image
CN110225248B (zh) 图像采集方法和装置、电子设备、计算机可读存储介质
WO2020168967A1 (zh) 图像采集方法、电子设备和计算机可读存储介质
WO2019183813A1 (zh) 一种拍摄方法及设备
CN110022469B (zh) 图像处理方法、装置、存储介质及电子设备
US10477106B2 (en) Control system, imaging device, and computer-readable medium
JP5497151B2 (ja) 自動バックライト検出
CN110246101B (zh) 图像处理方法和装置
EP3891974B1 (en) High dynamic range anti-ghosting and fusion
WO2022135581A1 (zh) 图像检测方法、装置、系统、设备和存储介质
CN110290325B (zh) 图像处理方法、装置、存储介质及电子设备
CN110049240B (zh) 摄像头控制方法、装置、电子设备和计算机可读存储介质
JP2003348438A (ja) 画像撮影方法および装置、画像選択方法および装置並びにプログラム
JP2013106284A (ja) 光源推定装置、光源推定方法、光源推定プログラムおよび撮像装置
CN110445986A (zh) 图像处理方法、装置、存储介质及电子设备
JP5782311B2 (ja) 撮像装置及びその制御方法
CN107682611B (zh) 对焦的方法、装置、计算机可读存储介质和电子设备
CN110572585B (zh) 图像处理方法、装置、存储介质及电子设备
US9628727B2 (en) Information processing apparatus and method, and image capturing system determining or acquiring target noise amount
CN110266965B (zh) 图像处理方法、装置、存储介质及电子设备
WO2022126379A1 (zh) 图像处理方法、装置及图像采集设备
CN115278069A (zh) 图像处理方法及装置、计算机可读存储介质、终端
US20190052803A1 (en) Image processing system, imaging apparatus, image processing apparatus, control method, and storage medium
WO2017096855A1 (zh) 伽马参数的动态调整方法及装置

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

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

Country of ref document: EP

Kind code of ref document: A1