WO2023240444A1 - 一种图像的处理方法、装置及存储介质 - Google Patents

一种图像的处理方法、装置及存储介质 Download PDF

Info

Publication number
WO2023240444A1
WO2023240444A1 PCT/CN2022/098665 CN2022098665W WO2023240444A1 WO 2023240444 A1 WO2023240444 A1 WO 2023240444A1 CN 2022098665 W CN2022098665 W CN 2022098665W WO 2023240444 A1 WO2023240444 A1 WO 2023240444A1
Authority
WO
WIPO (PCT)
Prior art keywords
color temperature
value
white balance
image
balance gain
Prior art date
Application number
PCT/CN2022/098665
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/CN2022/098665 priority Critical patent/WO2023240444A1/zh
Priority to CN202280004379.6A priority patent/CN117616774A/zh
Publication of WO2023240444A1 publication Critical patent/WO2023240444A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Definitions

  • the present disclosure relates to the field of image processing technology, and in particular, to an image processing method, device and storage medium.
  • the present disclosure provides an image processing method, device and storage medium.
  • an image processing method is provided, applied to an image acquisition device, and the method includes:
  • the target color temperature value and the target white balance gain value for white balance adjustment are determined.
  • the first color temperature weight of each pixel in the white point area is determined according to the color temperature interval in which each pixel in the white point area is located.
  • the first initial color temperature weight is adjusted to determine the first color temperature weight.
  • the average white balance gain value gain is performed on the pixel points in each of the color temperature intervals in the white point area, and the RGB value of each of the color temperature intervals after gain in the white point area is obtained;
  • determining the second color temperature weight of each color temperature interval based on the RGB value of each color temperature interval after gain includes:
  • the second color temperature weight of each color temperature interval is determined according to the overlapping area in each color temperature interval.
  • the size of the color temperature interval at the middle position is smaller than the size of the color temperature interval at the two end positions.
  • the target color temperature value and the target white balance gain value for white balance adjustment are determined based on the corresponding relationship between the white balance gain value and the color temperature and the white balance gain value of the white point area, including:
  • the white point area is determined based on the dark channel value and the grayscale value.
  • the method further includes:
  • the average of the pixel values of all pixel points is used as the pixel value of each reference image
  • the corresponding relationship between the white balance gain value and the color temperature value is determined.
  • an image processing device which is applied to an image acquisition device, and the device includes:
  • a first determination module configured to determine the corresponding grayscale image and dark channel image according to the initial image
  • a second determination module configured to determine the white point area in the initial image according to the grayscale image and the dark channel image
  • the third determination module is configured to determine the target color temperature value and the target white balance gain value for white balance adjustment according to the corresponding relationship between the white balance gain value and the color temperature and the white balance gain value of the white point area.
  • the technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: the white point area can be found more accurately, and the target white balance gain value for white balance adjustment can be accurately obtained, so that the image after white balance adjustment can be displayed Better results.
  • Figure 4 illustrates an example embodiment of determining the target color temperature value and target white balance gain value for white balance adjustment according to the corresponding relationship between the white balance gain value and color temperature and the white balance gain value of the white point area in step S104. method flow chart.
  • FIG. 5 is a flowchart illustrating a method for determining the white balance gain value of the white point area according to the white balance gain value of each pixel in step S402 according to an exemplary embodiment.
  • FIG. 6 is a flowchart of a method for determining the first color temperature weight related to the exposure index corresponding to each pixel in the white point area according to an exemplary embodiment.
  • FIG. 7 is a flowchart of a method for determining the second color temperature weight related to the color histogram corresponding to each pixel in the white point area, according to an exemplary embodiment.
  • FIG. 8 exemplarily shows a flowchart of the method for determining the second color temperature weight of each color temperature interval according to the RGB value after gain in step S705.
  • FIG. 9 is an example diagram of a color histogram according to an exemplary embodiment.
  • FIG. 14 is an example diagram showing an image obtained after processing by the image processing method of the present disclosure according to an exemplary embodiment.
  • Step S104 Determine a target color temperature value and a target white balance gain value for white balance adjustment based on the corresponding relationship between the white balance gain value and the color temperature and the white balance gain value of the white point area.
  • the image acquisition device includes smart phones, tablets, digital cameras, SLRs, mirrorless cameras and other electronic devices with image shooting functions, and also includes recorders, cameras, monitors and other electronic devices with video recording functions, which can perform Any image acquisition device is applicable, and the present disclosure does not limit the initial image acquisition device.
  • the initial image can be a color image without any processing after acquisition.
  • the white point area is determined through the grayscale image and dark channel image corresponding to the initial image, and the white balance gain value of the white point area is determined. According to the corresponding relationship between the white balance gain value and color temperature and The white balance gain value of the white point area determines the target color temperature value and target white balance gain value for white balance adjustment, which can more accurately find the white point area and accurately obtain the target white balance for white balance adjustment.
  • the gain value makes the display effect of the image after white balance adjustment better.
  • FIG. 4 shows a diagram of determining the target for white balance adjustment according to the corresponding relationship between the white balance gain value and the color temperature and the white balance gain value of the white point area in step S104 according to an exemplary embodiment.
  • Step S402 Determine the white balance gain value of the white point area based on the white balance gain value of each pixel point;
  • Step S403 Determine the target color temperature value and the target white balance gain value for white balance adjustment according to the corresponding relationship between the white balance gain value and the color temperature and the white balance gain value of the white point area.
  • the coordinate values corresponding to R/G and B/G in the coordinate system can be determined based on the white balance gain value, and then the coordinate values used for dialogue can be determined.
  • the corresponding target color temperature value for white balance adjustment in the point area After the target color temperature value is determined, based on the corresponding relationship between the white balance gain value and the color temperature, the target white balance gain value for white balance adjustment of the white point area can be determined.
  • X is the abscissa of the weighted average coordinate value of the white point area
  • Y is the ordinate of the weighted average coordinate value of the white point area
  • the vertical coordinate corresponding to the point W i1 is the first color temperature weight corresponding to the i-th pixel
  • W i2 is the second color temperature weight corresponding to the i-th pixel
  • m is the total number of pixels in the white point area.
  • the first color temperature weight related to the exposure index and the second color temperature weight related to the color histogram corresponding to each pixel in the white point area are respectively determined based on the influencing factors of the white balance adjustment. Then, based on the first color temperature weight and the second color temperature weight, the pixel values of each pixel in the white point area are weighted and summed, which can make the calculated white balance gain value of the white point area more accurate.
  • Step S601 divide into multiple exposure intervals according to the exposure index
  • Step S603 Determine the first color temperature weight of each pixel in the white point area based on the color temperature interval in which each pixel in the white point area is located.
  • determining the first color temperature weight based on the exposure index can reduce the impact of the exposure index on white balance adjustment and improve the accuracy of the target white balance gain value.
  • Figure 7 is a flow chart of a method for determining the second color temperature weight related to the color histogram corresponding to each pixel in the white point area according to an exemplary embodiment:
  • Step S702 divide each exposure interval into multiple color temperature intervals according to color temperature
  • Step S705 Determine the second color temperature weight of each color temperature interval based on the gain RGB values.
  • the division of the exposure intervals can be set according to actual needs. For example, when the exposure index range is [0,999], it is divided into 10 exposure intervals. Then divide each exposure interval into multiple color temperature intervals according to the color temperature value of each exposure interval. For example, divide the color temperature [1,10000] in each exposure interval into 15 color temperature intervals. The division of color temperature intervals can be based on the initial image divided by the color temperature distribution of each pixel in the image. The division of color temperature intervals can be set according to actual needs. It can be that the color temperature is equally divided according to the size of the color temperature value to obtain color temperature intervals of the same size, or it can be that the size of the color temperature interval in the middle is smaller than the color temperature interval at both ends. the size of.
  • the white balance gain values corresponding to all color temperature values in each color temperature interval After dividing the color temperature intervals, determine the white balance gain values corresponding to all color temperature values in each color temperature interval based on the corresponding relationship between the white balance gain value and the color temperature, and determine the average white balance gain within the color temperature interval based on all white balance gain values. value to calculate the average white balance gain value across all color temperature ranges. According to the pixel value of each pixel in the white point area, the color temperature value of each pixel is determined, and the color temperature interval to which each pixel belongs is calculated separately. For the pixels belonging to a certain color temperature interval, the average of the color temperature interval is used. Use the white balance gain value to gain the RGB value after gain in the white point area. According to the pixel value after gain, the second color temperature weight of each color temperature interval is determined.
  • the color temperature values of all pixels in the white point area belong to three color temperature intervals respectively, and the average white balance gain values of the three color temperature intervals are recorded as a1, a2 and a3 respectively, then for the white point area belonging to the
  • the pixels in one color temperature range use the white balance gain value a1 for gain
  • the pixels belonging to the second color temperature range use the white balance gain value a2 for gain
  • the pixels belonging to the third color temperature range use the white balance gain value a3. gain.
  • the second color temperature weight of the color temperature interval where each pixel point in the white point area is located is determined.
  • the second color temperature weight is determined based on the gain pixel value, which is equivalent to using the second color temperature weight based on the initial gain value. Making adjustments can further improve the accuracy of the target gain value.
  • Figure 8 exemplarily shows a flow chart of a method for determining the second color temperature weight of each color temperature interval according to the RGB value after gain in step S705:
  • Step S801 Determine the three-channel histogram of the R channel, G channel and B channel of each color temperature interval based on the RGB value of each color temperature interval after gain;
  • Step S802 determine the overlapping area of the three channels in the three-channel histogram of the R channel, G channel and B channel in each color temperature interval;
  • Step S803 Determine the second color temperature weight of each color temperature interval based on the overlapping area in each color temperature interval.
  • For the white point area count the pixels in the white point area included in each color temperature interval, and gain the white balance gain for each pixel in different color temperature intervals. Based on the RGB values after gain, determine the three-channel histogram of pixel values of all pixels in the white point area within the color temperature range.
  • the k-th color temperature interval includes y pixels in the white point area, and the average white balance gain value of the k-th color temperature interval is a k .
  • a three-channel histogram is drawn based on the R value, G value, and B value after gain of y pixel points.
  • the abscissa of the histogram is the pixel value of the channel, and the ordinate is The number of occurrences of each pixel value.
  • the R values of the three pixels are 50, 50, and 80 respectively, then the abscissa of the histogram is 50 and 80, and the ordinate is 1 and 2. points, 50 corresponds to 2, and 80 corresponds to 1.
  • W 2 represents the second color temperature weight
  • S k represents the overlapping area of the three-channel histogram in the k-th color temperature interval
  • n represents the number of color temperature intervals.
  • the color histogram usually reflects the distribution of pixel values, and determining the second color temperature weight based on the histogram can improve the accuracy of gain value calculation.
  • step S104 the target color temperature value and the target color temperature value for white balance adjustment are determined according to the corresponding relationship between the white balance gain value and the color temperature and the white balance gain value of the white point area.
  • the white balance gain value corresponding to the coordinate with the smallest distance from the coordinate corresponding to the white balance gain value in the white point area is selected as the target white balance gain value, and the corresponding color temperature value is used as the target Color temperature value.
  • the X-axis coordinate value and the Y-axis coordinate value and the corresponding white balance gain are reciprocal to each other. That is, the X-axis coordinate value is expressed as R/G, and the Y-axis coordinate value is expressed as B/G.
  • the weighted average coordinate values X and Y of the white point area do not necessarily fall on the curve of the corresponding relationship between the white balance gain value and the color temperature value.
  • the weighted average coordinate values X and Y of the white point area do not fall on the curve of the corresponding relationship between the white balance gain value and the color temperature value, it is necessary to find the corresponding color temperature value and white balance gain value on the curve to determine the value for dialogue.
  • the target color temperature value and target white balance gain value for white balance adjustment in the dot area Therefore, it is necessary to select the coordinates on the curve of the corresponding relationship between the white balance gain value and the color temperature value through the weighted average coordinate values X and Y of the white point area.
  • the coordinate point corresponding to the weighted average coordinate value X and Y of the white point area is Z
  • the coordinate point corresponding to the two nearest given color temperature values adjacent to the weighted average coordinate value of the white point area is the first
  • the coordinate point Z1 and the second coordinate point Z2 connect the first coordinate point Z1 and the second coordinate point Z2
  • the coordinate point Z corresponding to the weighted average coordinate values X and Y of the white point area is connected to the first coordinate point Z1 and the second coordinate point Z2.
  • the connection between the coordinate points Z2 is a vertical line
  • the image processing method further includes:
  • the target white balance gain value is adjusted.
  • the degree of reduction can be determined according to The distance between the color temperature value of the white point area and the target color temperature value is determined. The farther the distance, the greater the reduction value. The closer the distance, the smaller the reduction value.
  • the degree of increase can be determined according to the white balance gain value.
  • the distance between the color temperature value of the point area and the target color temperature value is determined. The farther the distance is, the larger the increase value is. The closer the distance is, the smaller the increase value is.
  • the target white balance gain value is fine-tuned according to the relationship between the coordinate points of the target color temperature value and the actually obtained coordinate points, which can further improve the accuracy.
  • Figure 10 exemplarily shows the flow chart of the method for determining the white point area in the initial image according to the grayscale image and the dark channel image in step S103:
  • Step S1001 determine the pixel value corresponding to the three RGB channels of each pixel of the initial image
  • Step S1004 Determine the white point area based on the dark channel value and grayscale value.
  • FIG. 11 is an example of a dark channel image and a grayscale image according to an exemplary embodiment. As shown in FIG. 11 , the left side is the dark channel image and the right side is the grayscale image. Based on the dark channel value and gray value of each pixel, the white point area of the initial image is determined.
  • the white point area is determined through the grayscale image and the dark channel image, which can improve the accuracy of identifying the white point area.
  • Figure 12 exemplarily shows a flow chart of the method for determining the white point area according to the dark channel value and the gray value in step S1004:
  • Step S1201 determine the first area in the initial image whose dark channel value is greater than the first preset threshold
  • the first area in the initial image whose dark channel value is greater than the first preset threshold can be selected, and the grayscale value is greater than the second preset threshold and less than the third
  • the second area in the initial image of the preset threshold is taken as the intersection between the first area and the second area as the white point area in the initial image.
  • the first preset threshold can be determined according to an adaptive threshold determination method, for example, calculated using the maximum inter-class variance method.
  • FIG. 13 is an example diagram after threshold segmentation according to an exemplary embodiment.
  • the second preset threshold may be 5
  • the third preset threshold may be 230.
  • the intersection between the first area and the second area is determined as the white point area in the initial image, which can fully consider the pixel values in the initial image, so that the obtained white point area is more precise.
  • FIG 14 is an example diagram showing an image obtained after processing by the image processing method of the present disclosure according to an exemplary embodiment. As shown in Figure 14, columns a and c are the acquired initial images, and columns b and d are the processed images. Image, it can be seen that the white balance effect of the processed image is better.
  • FIG. 15 is a block diagram of an image processing device according to an exemplary embodiment:
  • the acquisition module 1501 is configured to acquire the initial image acquired by the image acquisition device
  • the first determination module 1502 is configured to determine the corresponding grayscale image and dark channel image according to the initial image
  • the second determination module 1503 is configured to determine the white point area in the initial image according to the grayscale image and the dark channel image;
  • the third determination module 1504 is configured to determine the target color temperature value and the target white balance gain value for white balance adjustment according to the corresponding relationship between the white balance gain value and the color temperature and the white balance gain value of the white point area.
  • the white point area can be found more accurately, and the target white balance gain value for white balance adjustment can be accurately obtained, so that the display effect of the white balance adjusted image is better.
  • the third determining module 1504 is further configured to:
  • the target color temperature value and the target white balance gain value for white balance adjustment are determined.
  • the third determining module 1504 is further configured to:
  • the white balance gain value of the white point area is determined according to the pixel value of each pixel point and the first color temperature weight and the second color temperature weight.
  • the third determining module 1504 is further configured to:
  • the first color temperature weight of each pixel in the white point area is determined according to the color temperature interval in which each pixel in the white point area is located.
  • the third determining module 1504 is further configured to:
  • the ratio of the number of pixels in the color temperature interval to the number of all pixels is determined as the first initial color temperature weight
  • the first initial color temperature weight is adjusted to determine the first color temperature weight.
  • the third determining module 1504 is further configured to:
  • the average white balance gain value gain is performed on the pixel points in each of the color temperature intervals in the white point area, and the RGB value of each of the color temperature intervals after gain in the white point area is obtained;
  • the second color temperature weight of each color temperature interval is determined according to the RGB value of each color temperature interval after gain.
  • the third determining module 1504 is further configured to:
  • the second color temperature weight of each color temperature interval is determined according to the overlapping area in each color temperature interval.
  • the size of the color temperature interval at the middle position is smaller than the size of the color temperature interval at the two end positions.
  • the third determining module 1504 is further configured to:
  • the white balance gain value corresponding to the coordinate with the smallest distance from the coordinate corresponding to the white balance gain value of the white point area is selected as the target white balance gain value
  • the corresponding color temperature value is used as the target color temperature value.
  • the device further includes:
  • the adjustment module 1505 is configured to adjust the target white balance gain value according to the relationship between the color temperature value of the white point area and the target color temperature value.
  • the second determination module 1503 is further configured to:
  • the white point area is determined based on the dark channel value and the grayscale value.
  • the second determination module 1503 is further configured to:
  • intersection between the first area and the second area is determined as the white point area in the initial image.
  • the device further includes a calibration module 1506 configured to:
  • the average of the pixel values of all pixel points is used as the pixel value of each reference image
  • the corresponding relationship between the white balance gain value and the color temperature value is determined.
  • FIG. 16 is a block diagram of an image processing device 1600 according to an exemplary embodiment.
  • the device 1600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
  • the device 1600 may include one or more of the following components: a processing component 1602, a memory 1604, a power supply component 1606, a multimedia component 1608, an audio component 1610, an input/output (I/O) interface 1612, a sensor component 1614, and communications component 1616.
  • Processing component 1602 generally controls the overall operations of device 1600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 1602 may include one or more processors 1620 to execute instructions to complete all or part of the steps of the above method.
  • processing component 1602 may include one or more modules that facilitate interaction between processing component 1602 and other components.
  • processing component 1602 may include a multimedia module to facilitate interaction between multimedia component 1608 and processing component 1602.
  • Memory 1604 is configured to store various types of data to support operations at device 1600 . Examples of such data include instructions for any application or method operating on device 1600, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 1604 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Power supply component 1606 provides power to various components of device 1600.
  • Power supply components 1606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 1600 .
  • Multimedia component 1608 includes a screen that provides an output interface between the device 1600 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action.
  • multimedia component 1608 includes a front-facing camera and/or a rear-facing camera.
  • the front camera and/or the rear camera may receive external multimedia data.
  • Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
  • Audio component 1610 is configured to output and/or input audio signals.
  • audio component 1610 includes a microphone (MIC) configured to receive external audio signals when device 1600 is in operating modes, such as call mode, recording mode, and speech recognition mode. The received audio signals may be further stored in memory 1604 or sent via communication component 1616 .
  • audio component 1610 also includes a speaker for outputting audio signals.
  • the I/O interface 1612 provides an interface between the processing component 1602 and a peripheral interface module.
  • the peripheral interface module may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
  • Sensor component 1614 includes one or more sensors that provide various aspects of status assessment for device 1600 .
  • the sensor component 1614 can detect the open/closed state of the device 1600, the relative positioning of components, such as the display and keypad of the device 1600, and the sensor component 1614 can also detect a change in position of the device 1600 or a component of the device 1600. , the presence or absence of user contact with device 1600 , device 1600 orientation or acceleration/deceleration and temperature changes of device 1600 .
  • Sensor component 1614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 1614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 1614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communications component 1616 is configured to facilitate wired or wireless communications between device 1600 and other devices.
  • Device 1600 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, or a combination thereof.
  • the communication component 1616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communications component 1616 also includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • apparatus 1600 may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable Gate array
  • controller microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • a non-transitory computer-readable storage medium including instructions such as a memory 1604 including instructions, executable by the processor 1620 of the device 1600 to complete the above method is also provided.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • a non-transitory computer-readable storage medium when instructions in the storage medium are executed by a processor of a device, enable the device to perform an image processing method, and the method includes any of the above methods.
  • the method in this article can more accurately find the white point area and accurately obtain the target white balance gain value for white balance adjustment, making the display effect of the white balance adjusted image better.

Landscapes

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

Abstract

本公开是关于一种图像的处理方法、装置及存储介质。图像的处理方法应用于图像获取装置,包括:获取图像获取装置所获取的初始图像;根据初始图像确定对应的灰度图和暗通道图;根据灰度图和暗通道图,确定初始图像中的白点区域;根据白平衡增益值与色温的对应关系以及白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。

Description

一种图像的处理方法、装置及存储介质 技术领域
本公开涉及图像处理技术领域,尤其涉及一种图像的处理方法、装置及存储介质。
背景技术
一方面,随着高像素手机、单反、微单等图像采集设备的不断普及,对采集到的图像要求越来越高,使图像颜色保持真实而不失真尤为重要。另一方面,随着无人驾驶、人工智能等技术的不断发展,视觉系统越来越重要,而图像的偏色现象对视觉系统的影响十分巨大,因此对记录仪、监控器、摄像机等这类图像采集设备偏色优化校正能力提出了更高的要求。相关技术中,想要做好图像色偏校正、实现较好的自动白平衡效果,使图像颜色保持真实而不失真,需要图像采集系统能够在各种不同光源情况中都能精确地去除光源色温对图像色彩的影响,以达到良好的自动白平衡效果。
发明内容
为克服相关技术中存在的问题,本公开提供一种图像的处理方法、装置及存储介质。
根据本公开实施例的第一方面,提供一种图像的处理方法,应用于图像获取装置,所述方法包括:
获取所述图像获取装置所获取的初始图像;
根据所述初始图像确定对应的灰度图和暗通道图;
根据所述灰度图和所述暗通道图,确定所述初始图像中的白点区域;
根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
在一示例性的实施例中,所述根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值,包括:
确定所述白点区域中每个像素点的白平衡增益值;
根据所述每个像素点的白平衡增益值,确定所述白点区域的白平衡增益值;
根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
在一示例性的实施例中,所述根据所述每个像素点的白平衡增益值,确定所述白点区域 的白平衡增益值,包括:
确定所述白点区域中每个像素点对应的与曝光指数相关的第一色温权重以及与颜色直方图相关的第二色温权重;
根据所述每个像素点的像素值以及所述第一色温权重和所述第二色温权重,确定所述白点区域的白平衡增益值。
在一示例性的实施例中,确定所述白点区域中每个像素点对应的与曝光指数相关的第一色温权重,包括:
根据所述曝光指数将所述初始图像划分为多个曝光区间;
将每个所述曝光区间,按照色温划分为多个色温区间;
根据所述白点区域中每个像素点所在的色温区间,确定所述白点区域中每个像素点的所述第一色温权重。
在一示例性的实施例中,所述根据所述白点区域中每个像素点所在的色温区间,确定所述第一色温权重,包括:
确定所述白点区域中所有像素点的个数以及每个像素点所在的所述色温区间;
针对每个所述色温区间,将所述色温区间内像素点的个数占所述所有像素点的个数的比例确定为第一初始色温权重;
根据环境光信息,调整第一初始色温权重,确定所述第一色温权重。
在一示例性的实施例中,确定所述白点区域中每个像素点对应的与颜色直方图相关的第二色温权重,包括:
根据所述曝光指数将所述初始图像划分为多个曝光区间;
将每个所述曝光区间,按照色温划分为多个色温区间;
根据白平衡增益值与色温的对应关系,确定每个所述色温区间的平均白平衡增益值;
根据所述平均白平衡增益值,对所述白点区域中处于各个所述色温区间的像素点进行增益,得到所述白点区域增益后的每个所述色温区间的RGB值;
根据增益后的每个所述色温区间的RGB值,确定每个色温区间的所述第二色温权重。
在一示例性的实施例中,所述根据增益后的每个所述色温区间的RGB值,确定每个色温区间的第二色温权重,包括:
根据增益后的每个所述色温区间的RGB值,确定每个所述色温区间的R通道、G通道和B通道的三通道直方图;
确定所述每个所述色温区间的R通道、G通道和B通道的三通道直方图中的三个通道的 重合面积;
根据每个所述色温区间内的所述重合面积,确定每个所述色温区间的所述第二色温权重。
在一示例性的实施例中,根据色温值的大小,处于中间位置的色温区间的大小小于处于两端位置的色温区间的大小。
在一示例性的实施例中,根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值,包括:
选择所述白平衡增益值和所述色温值的对应关系中,与所述白点区域的白平衡增益值对应的坐标的距离最小的坐标所对应的白平衡增益值作为目标白平衡增益值,对应的色温值作为目标色温值。
在一示例性的实施例中,所述方法还包括:
根据所述白点区域的色温值和所述目标色温值的关系,对目标白平衡增益值进行调整。
在一示例性的实施例中,根据所述灰度图和所述暗通道图,确定所述初始图像中的白点区域,包括:
确定所述初始图像的每个像素的RGB三个通道对应的像素值;
根据所述RGB三个通道对应的像素值,确定暗通道图中每个像素对应的暗通道值;
确定所述初始图像的每个像素对应的灰度值;
根据所述暗通道值和所述灰度值,确定所述白点区域。
在一示例性的实施例中,根据所述暗通道值和所述灰度值,确定所述白点区域,包括:
确定暗通道值大于第一预设阈值的所述初始图像中的第一区域;
确定所述灰度值大于第二预设阈值小于第三预设阈值的所述初始图像中的第二区域;
将所述第一区域和所述第二区域之间的交集确定为所述初始图像中的白点区域。
在一示例性的实施例中,所述方法还包括:
在不同给定色温值下,获取预设灰度值的灰色目标对象的多张参考图像;
针对每张参考图像,将所有像素点的像素值的平均值作为每张所述参考图像的像素值;
根据所述参考图像的像素值,确定所述参考图像对应的白平衡增益值;
根据所述白平衡增益值和所述给定色温值,确定所述白平衡增益值和所述色温值的对应关系。
根据本公开实施例的第二方面,提供一种图像的处理装置,应用于图像获取装置,所述装置包括:
获取模块,被配置为获取所述图像获取装置所获取的初始图像;
第一确定模块,被配置为根据所述初始图像确定对应的灰度图和暗通道图;
第二确定模块,被配置为根据所述灰度图和所述暗通道图,确定所述初始图像中的白点区域;
第三确定模块,被配置为根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
本公开的实施例提供的技术方案可以包括以下有益效果:能够更加准确的找出白点区域,并准确得出用于白平衡调节的目标白平衡增益值,使得白平衡调节后的图像的显示效果更好。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1是根据一示例性实施例示出的一种图像的处理方法的流程图。
图2示例性的示出了本公开实施例所提出的白平衡增益值与色温的对应关系的示意图。
图3示例性示出了本公开实施例确定所提供的白平衡增益值和色温值的对应关系的方法流程图。
图4是根据一示例性实施例示出的步骤S104中根据白平衡增益值与色温的对应关系以及白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值的方法流程图。
图5是根据一示例性实施例示出了步骤S402中根据每个像素点的白平衡增益值,确定白点区域的白平衡增益值的方法流程图。
图6是根据一示例性实施例示出的确定白点区域中每个像素点对应的与曝光指数相关的第一色温权重的方法流程图。
图7是根据一示例性实施例示出的确定白点区域中每个像素点对应的与颜色直方图相关的第二色温权重的方法流程图。
图8示例性地示出了步骤S705中根据增益后的RGB值,确定每个色温区间的第二色温权重的方法流程图。
图9是根据一示例性实施例示出的颜色直方图的示例图。
图10示例性地示出了步骤S103中根据灰度图和暗通道图,确定初始图像中的白点区域 的方法流程图。
图11是根据一示例性实施例示出的暗通道图和灰度图的示例图。
图12示例性地示出了步骤S1004中根据暗通道值和灰度值,确定白点区域的方法流程图。
图13是根据一示例性实施例示出的进行阈值分割之后的示例图。
图14是根据一示例性的实施例示出本公开图像处理方法处理后得到的图像示例图。
图15是根据一示例性实施例示出的一种图像的处理装置框图。
图16是根据一示例性实施例示出的一种用于图像的处理装置的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
相关技术中,采用灰度世界(Gray World)算法进行白平衡调节,灰度世界算法是以灰度世界假设为基础,该假设认为:对于一幅有着大量色彩变化的图像,红色(Red,R)、绿色(Green,G)和蓝色(Blue,B)三个分量的饱和度的平均值趋于同一灰度值,即灰度世界算法假设自然界景物对于光线的平均反射的均值在总体上是个定值,这个定值中R、G、B三个分量的饱和度趋于一致。当图像中存在丰富的色彩时,通过该灰度世界算法对图像进行处理,可以更好地消除环境光的影响。但是,当图像包含大面积单色或主色时,该方法的调节效果较差。
本公开示例性的实施例中,提供一种图像的处理方法,应用于图像获取装置。图1是根据一示例性实施例示出的一种图像的处理方法的流程图:
步骤S101:获取图像获取装置所获取的初始图像;
步骤S102:根据初始图像确定对应的灰度图和暗通道图;
步骤S103:根据灰度图和暗通道图,确定初始图像中的白点区域;
步骤S104:根据白平衡增益值与色温的对应关系以及白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
在本公开示例性的实施例中,为了克服相关技术中的问题,提供一种图像的处理方法。获取图像获取装置所获取的初始图像,并分别转换成对应的灰度图和暗通道图,根据灰度图和暗通道图,确定初始图像中的白点区域,并确定白点区域的白平衡增益值,根据预设的白 平衡增益值与色温的对应关系以及白点区域的白平衡增益值,确定目标色温值,根据预设的白平衡增益值与色温的对应关系以及目标色温值,确定用于白平衡调节的目标白平衡增益值,使用目标白平衡增益值对图像进行白平衡调节,能够得到颜色校正较好的图像,即所得到的图像与色彩标准的图像相差较小。
在步骤S101中,图像获取装置包括智能手机、平板、数码相机、单反、微单等具有图像拍摄功能的电子设备,还包括记录仪、摄像机、监视器等具有视频录制功能的电子设备,能够进行图像获取的装置均能适用,对于初始图像的获取装置,本公开不做限制。初始图像可以为获取后未做任何处理的彩色图像。
在步骤S102中,根据初始图像确定其对应的灰度图和暗通道图。灰度图的转换方法可以采用任意能够转换为灰度图的方法,例如采用平均值法或者加权平均值法。在初始图像中每个像素点的R通道、G通道和B通道三个通道中的像素值中取最小值,作为暗通道图该像素点的像素值,由此形成暗通道图。
在步骤S103中,确定白点区域时,可以根据预设的灰度阈值和暗通道阈值,分别在灰度图和暗通道图中,选择出符合预设条件的区域,并将所选择出的区域的重合区域作为白点区域。白点区域的大小和个数根据图像的实际情况确定。
在步骤S104中,预先在图像获取装置中存储白平衡增益值与色温的对应关系,白平衡增益值与色温的对应关系可以在R/G、B/G坐标系中体现。如图2所示,图2示例性的示出了本公开实施例所提出的白平衡增益值与色温的对应关系的示意图,其中,R/G和B/G为坐标系中的两个坐标轴。在R/G和B/G的曲线上,标识了对应的色温,即标注了获得相应的RGB值时对应的色温,例如在图2中曲线上用不同的形状对应标识了对应不同的色温。由于白平衡增益通常采用对R通道的增益Rgain和B通道的增益Bgain,其中Rgain=G/R、Bgain=G/B,因此在R/G、B/G坐标系中能够反映白平衡增益值与色温的对应关系。确定出白点区域后,确定白点区域的白平衡增益值,再根据白平衡增益值与色温的对应关系,确定对应的目标色温值,即根据白点区域在坐标系中的坐标值,以及坐标系中不同坐标点对应的色温值,确定白点区域坐标值对应的目标色温值。确定出目标色温值后,根据白平衡增益值与色温的对应关系,即可确定用于白平衡调节的目标白平衡增益值。
本公开示例性的实施例中,通过初始图像对应的灰度图和暗通道图,确定白点区域,并确定出白点区域的白平衡增益值,根据白平衡增益值和色温的对应关系以及白点区域的白平衡增益值,确定出用于白平衡调节的目标色温值和目标白平衡增益值,能够更加准确的找出白点区域,并准确得出用于白平衡调节的目标白平衡增益值,使得白平衡调节后的图像的显 示效果更好。
在本公开示例性的实施例中,还提供了确定白平衡增益值和色温值的对应关系的方法。如图3所示,图3示例性示出了本公开实施例确定所提供的白平衡增益值和色温值的对应关系的方法流程图:
步骤S301,在不同给定色温值下,获取预设灰度值的灰色目标对象的多张参考图像;
步骤S302,针对每张参考图像,将所有像素点的像素值的平均值作为每张参考图像的像素值;
步骤S303,根据参考图像的像素值,确定参考图像对应的白平衡增益值;
步骤S304,根据白平衡增益值和给定色温值,确定白平衡增益值和色温值的对应关系。
不同给定色温值可以通过实验室标准光源提供,例如标准光源D75、D65、D50、CWF、TL84、A、H等,预设灰度值的灰色目标对象可以为标准灰卡,使用图像获取装置在不同色温值的不同光源下获取标准灰卡的图像,作为参考图像。为了保证参考图像的准确性,使用图像获取装置获取参考图像时,将标准灰卡区域充满图像获取装置的整个视场区域,使得所获取的参考图像中不包括标准灰卡之外的区域。
对于每张参考图像,将所有像素点的像素值的平均值作为整张图像的像素值,例如,第i个像素点的像素值记为(R i,G i,B i),参考图像中包括N个像素点,则该参考图像的像素值表示为
Figure PCTCN2022098665-appb-000001
白平衡增益值采用对R通道的增益Rgain和对B通道的增益Bgain,其中Rgain=G/R、Bgain=G/B,根据像素值即可确定每张参考图像的白平衡增益值,由此可以确定R/G、B/G坐标系中的横坐标和纵坐标。
根据参考图像的白平衡增益值和每张参考图像对应的给定色温值,即可确定出给定色温值和白平衡增益值的对应关系,对于非给定色温值,采用线性插值的方式得出,即可得到如2所示的白平衡增益值和色温值的对应关系。以R/G作为横坐标,B/G作为纵坐标,建立坐标系。由于白平衡增益通常采用对R通道的增益Rgain和B通道的增益Bgain表示,Rgain=G/R、Bgain=G/B,通过图2中R/G与B/G对应坐标与色温值的对应关系,进而可以确定白平衡增益与色温值的对应关系。
在一示例性实施例中,图4是根据一示例性实施例示出的步骤S104中根据白平衡增益值与色温的对应关系以及白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值的方法流程图:
步骤S401:确定白点区域中每个像素点的白平衡增益值;
步骤S402:根据每个像素点的白平衡增益值,确定白点区域的白平衡增益值;
步骤S403:根据白平衡增益值与色温的对应关系以及白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
由于白点区域的大小和个数都是根据实际拍摄的初始图像确定的,因此,在确定白点区域的白平衡增益值时,可以通过白点区域中每个像素点的白平衡增益值来确定,例如可以根据白点区域中所有的像素点坐标值的平均值或者加权平均值,得出白点区域对应的色温坐标,根据色温坐标得出白点区域的白平衡增益值。由于白平衡增益可以由Rgain=G/R和Bgain=G/B表示,因此可以通过每个像素点的像素值确定每个点的白平衡增益值。根据白点区域中所有像素点的白平衡增益值,确定白点区域的白平衡增益值。利用白平衡增益值与R/G、B/G坐标系中的坐标值的对应关系,可以根据白平衡增益值确定坐标系中R/G、B/G对应的坐标值,进而确定用于对白点区域进行白平衡调节的对应的目标色温值。确定出目标色温值后,根据白平衡增益值与色温的对应关系,即可确定用于对白点区域进行白平衡调节的目标白平衡增益值。
在一示例性实施例中,图5是根据一示例性实施例示出了步骤S402中根据每个像素点的白平衡增益值,确定白点区域的白平衡增益值的方法流程图:
步骤S501:确定白点区域中每个像素点对应的与曝光指数相关的第一色温权重以及与颜色直方图相关的第二色温权重;
步骤S502:根据每个像素点的像素值以及第一色温权重和第二色温权重,确定白点区域的白平衡增益值。
为了计算的准确性,在根据每个像素点的白平衡增益值,确定白点区域的白平衡增益值时,可以通过将每个像素点的白平衡增益值进行加权求和,得到白点区域的白平衡增益值。考虑到白平衡调节的影响因素,分别确定白点区域中每个像素点对应的与曝光指数相关的第一色温权重以及与颜色直方图相关的第二色温权重。根据白点区域中每个像素点的像素值可以确定每个像素点在R/G、B/G坐标系中的坐标值,R/G、B/G坐标系反映了白平衡增益值和色温的对应关系,因此所确定的每个像素点的坐标值能够反映每个像素点的色温值,再根据第一色温权重和第二色温权重,对每个像素点的坐标值进行加权平均,得到白点区域的加权平均坐标值,即得到白点区域的色温坐标,进而得到白点区域的白平衡增益值。
每个像素点的坐标记为(X i,Y i),通过计算每个像素点的坐标值的加权平均值,得到加权平均坐标值,来表示白点区域的色温,加权平均坐标(X,Y)表示为:
Figure PCTCN2022098665-appb-000002
Figure PCTCN2022098665-appb-000003
其中,X为白点区域的加权平均坐标值的横坐标,Y为白点区域的加权平均坐标值的纵坐标,X i为第i个像素点对应的横坐标,Y i为第i个像素点对应的纵坐标,W i1为第i个像素点对应的第一色温权重,W i2为第i个像素点对应的第二色温权重,m为白点区域中像素点的总个数。
本公开示例性的实施例中,结合白平衡调节的影响因素,分别确定白点区域中每个像素点对应的与曝光指数相关的第一色温权重以及与颜色直方图相关的第二色温权重,再基于第一色温权重和第二色温权重,将白点区域中每个像素点的像素值进行加权求和,能够使得所计算的白点区域的白平衡增益值更加准确。
在一示例性实施例中,提出了一种第一色温权重的确定方法。如图6所示,图6是根据一示例性实施例示出的确定白点区域中每个像素点对应的与曝光指数相关的第一色温权重的方法流程图:
步骤S601,根据曝光指数划分为多个曝光区间;
步骤S602,将每个曝光区间,按照色温划分为多个色温区间;
步骤S603,根据白点区域中每个像素点所在的色温区间,确定白点区域中每个像素点的第一色温权重。
根据图像获取装置的曝光指数划分为多个曝光区间,曝光区间的划分可以根据实际需求设定,例如曝光指数范围为[0,999]时,划分为10个曝光区间。再根据每个曝光区间的色温值将每个曝光区间划分为多个色温区间,例如将每个曝光区间内的色温[1,10000]划分为15个色温区间。色温区间的划分可以根据实际需求设定,可以是根据色温值的大小对色温进行等分得到大小相同的色温区间,也可以是处于中间位置的色温区间的大小小于处于两端位置的色温区间的大小。根据白点区域中每个像素点所在的色温区间,确定白点区域中每个色温区间的第一色温权重。
本公开示例性的实施例中,根据曝光指数确定第一色温权重,能够减少曝光指数对白平衡调节的影响程度,提高目标白平衡增益值的准确性。
在一示例性实施例中,根据白点区域中每个像素点所在的色温区间,确定第一色温权重,包括:
确定白点区域中所有像素点的个数以及每个像素点所在的色温区间;
针对每个色温区间,将色温区间内像素点的个数占所有像素点的个数的比例确定为第一 初始色温权重;
根据环境光信息,调整第一初始色温权重,确定第一色温权重。
确定白点区域中所有像素点的个数以及每个像素点所在的色温区间,将属于某一色温区间的像素点的个数占白点区域中所有像素点个数的比例,作为该色温区间的第一初始色温权重。例如,白点区域中包括4000个像素点,属于色温区间1的像素点的个数为500,则色温区间1的第一初始色温权重为500/4000=1/8。再根据获取初始图像时的环境光信息,对第一初始色温权重进行调整,调整规则可以根据实际需求设定,调整后的色温权重作为第一色温权重。环境光信息可以包括环境光的色温,例如,色温区间1的色温范围为200-1000,而此时环境光的色温为8000,则对于色温区间1的权重可以适当减小。
本公开示例性的实施例中,根据曝光指数确定第一初始色温权重,再根据环境光信息调整第一初始色温权重,确定第一色温权重,进一步提高计算的准确性。
在一示例性实施例中,提出了一种第二色温权重的确定方法。如图7所示,图7是根据一示例性实施例示出的确定白点区域中每个像素点对应的与颜色直方图相关的第二色温权重的方法流程图:
步骤S701,根据曝光指数将初始图像划分为多个曝光区间;
步骤S702,将每个曝光区间,按照色温划分为多个色温区间;
步骤S703,根据白平衡增益值与色温的对应关系,确定每个色温区间的平均白平衡增益值;
步骤S704,根据平均白平衡增益值,对初始图像中处于各个色温区间的像素点进行增益,得到初始图像增益后的RGB值;
步骤S705,根据增益后的RGB值,确定每个色温区间的第二色温权重。
根据图像获取装置的曝光指数划分为多个曝光区间,曝光区间的划分可以根据实际需求设定,例如曝光指数范围为[0,999]时,划分为10个曝光区间。再根据每个曝光区间的色温值将每个曝光区间划分为多个色温区间,例如将每个曝光区间内的色温[1,10000]划分为15个色温区间,色温区间的划分可以根据初始图像中的每个像素点的色温分布来划分。色温区间的划分可以根据实际需求设定,可以是根据色温值的大小,对色温进行等分得到大小相同的色温区间,也可以是处于中间位置的色温区间的大小小于处于两端位置的色温区间的大小。
划分完色温区间后,根据白平衡增益值与色温的对应关系,确定每个色温区间内所有色温值对应的白平衡增益值,并根据所有白平衡增益值确定该色温区间内的平均白平衡增益值,从而计算所有色温区间的平均白平衡增益值。根据白点区域中每个像素点的像素值,确定每 个像素点的色温值,并分别统计每个像素点属于的色温区间,对于属于某一色温区间的像素点均使用该色温区间的平均白平衡增益值进行增益,获得白点区域增益后的RGB值。根据增益后的像素值,确定每个色温区间的第二色温权重。
在一示例中,白点区域中的所有像素点的色温值分别属于三个色温区间,三个色温区间的平均白平衡增益值分别记为a1、a2和a3,则对于白点区域中属于第一个色温区间的像素点使用白平衡增益值a1进行增益,属于第二个色温区间的像素点使用白平衡增益值a2进行增益,属于第三个色温区间的像素点使用白平衡增益值a3进行增益。根据增益后的像素值,确定白点区域中每个像素点所在的色温区间的第二色温权重。
本公开示例性的实施例中,根据初始图像中相关的增益值对图像进行增益后,根据增益后的像素值确定第二色温权重,相当于在初始增益值的基础上进行使用第二色温权重进行调整,能够进一步提高目标增益值的准确性。
在一示例性实施例中,如图8所示,图8示例性地示出了步骤S705中根据增益后的RGB值,确定每个色温区间的第二色温权重的方法流程图:
步骤S801,根据增益后的每个色温区间的RGB值,确定每个色温区间的R通道、G通道和B通道的三通道直方图;
步骤S802,确定每个色温区间的R通道、G通道和B通道的三通道直方图中的三个通道的重合面积;
步骤S803,根据每个色温区间内的重合面积,确定每个色温区间的第二色温权重。
对于白点区域,统计每个色温区间所包括的白点区域中的像素点,并每个像素点,针对不同色温区间的白平衡增益进行增益。根据增益后的RGB值,确定该色温区间内的白点区域的所有像素点的像素值三通道直方图。
在一示例中,第k个色温区间内包括白点区域的y个像素点,第k个色温区间的平均白平衡增益值为a k,对于y个像素点分别用a k进行增益后,得到增益后的R值、G值、B值,根据y个像素点增益后的R值、G值、B值画出三通道直方图,直方图的横坐标为该通道的像素值,纵坐标为每个像素值出现的次数。例如,对于R通道,当只有3个像素点时,三个像素点的R值分别为50、50、80,则直方图的横坐标为50和80两个点,纵坐标为1和2两个点,50对应的是2,80对应的是1。
图9是根据一示例性实施例示出的颜色直方图的示例图,如图9所示,根据白点区域的像素点所在的每个色温区间中三通道直方图的重合面积,使用以下公式确定第二色温权重:
Figure PCTCN2022098665-appb-000004
其中,W 2表示第二色温权重,S k表示第k个色温区间中三通道直方图的重合面积,n表示色温区间的个数。
本公开示例性的实施例中,颜色直方图通常反映像素值的分布情况,根据直方图确定第二色温权重,能够提高增益值计算的准确性。
在一示例性实施例中,示例性地示出了步骤S104中根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值的方法:
选择白平衡增益值和色温值的对应关系中,与白点区域的白平衡增益值对应的坐标的距离最小的坐标所对应的白平衡增益值作为目标白平衡增益值,对应的色温值作为目标色温值。
在图2所示的白平衡增益值和色温值的对应关系中,X轴坐标值和Y轴坐标值与对应的白平衡增益互为倒数的关系。即X轴坐标值表示为R/G,Y轴坐标值表示为B/G。而白平衡增益可以由Rgain=G/R和Bgain=G/B表示。在确定了白点区域的加权平均坐标值X和Y后,即可以确定白点区域的白平衡增益值。
白点区域的加权平均坐标值X和Y不一定落在白平衡增益值和色温值的对应关系的曲线上。当白点区域的加权平均坐标值X和Y未落入到白平衡增益值和色温值的对应关系的曲线上时,需要找到曲线上对应的色温值以及白平衡增益值,以确定用于对白点区域进行白平衡调节的目标色温值和目标白平衡增益值。因此,需要通过白点区域的加权平均坐标值X和Y,来选择白平衡增益值和色温值的对应关系的曲线上的坐标,例如确定出白点区域的加权平均坐标值X和Y在坐标上对应的点后,找出白平衡增益值和色温值的对应关系的曲线上与其距离最小的坐标点,并将该坐标点对应白平衡增益值作为目标白平衡增益值。
如图2所示,白点区域的加权平均坐标值X和Y对应的坐标点为Z,与白点区域的加权平均坐标值相邻最近的两个给定色温值对应的坐标点为第一坐标点Z1和第二坐标点Z2,将第一坐标点Z1和第二坐标点Z2相连,将白点区域的加权平均坐标值X和Y对应的坐标点Z向第一坐标点Z1和第二坐标点Z2之间的连线做垂线,垂线与白平衡增益值和色温值的对应关系的曲线上的交点Z0。如果线段Z0Z1小于线段Z0Z2,则Z1坐标所对应的色温值为目标色温值,对应的白平衡增益为目标白平衡增益;否则,Z2坐标所对应的色温值为目标色温值,对应的白平衡增益为目标白平衡增益。
在一示例性实施例中,图像的处理方法还包括:
根据白点区域的色温值和目标色温值的关系,对目标白平衡增益值进行调整。
在图2所示的白平衡增益值和色温值的对应关系的曲线上,当白点区域的加权平均坐标值X和Y对应的坐标点Z在目标色温值对应的坐标点的上方时,则白点区域的加权平均坐标值横坐标X或者纵坐标Y大于目标色温值的横坐标或者纵坐标,由于坐标系中的横坐标和纵坐标与增益值互为倒数关系,因此白点区域的色温值对应的白平衡增益值小于目标色温值对应的白平衡增益值,因此,需要适当减小目标色温值对应的白平衡增益值,即适当减小目标白平衡增益值,减小的程度可以根据白点区域的色温值和目标色温值之间的距离远近确定,距离越远时,减小值越大,距离越近时,减小值越小。
在图2所示的白平衡增益值和色温值的对应关系的曲线上,当白点区域的加权平均坐标值X和Y对应的坐标点Z在目标色温值对应的坐标点的下方时,则白点区域的加权平均坐标值横坐标X或者纵坐标Y小于于目标色温值的横坐标或者纵坐标,由于坐标系中的横坐标和纵坐标与增益值互为倒数关系,因此白点区域的色温值对应的增益值大于目标色温值对应的白平衡增益值,因此,需要适当增大目标色温值对应的白平衡增益值,即适当增大目标白平衡增益值,增大的程度可以根据白点区域的色温值和目标色温值之间的距离远近确定,距离越远时,增大值越大,距离越近时,增大值越小。
本公开示例性的实施例中,在目标白平衡增益值的基础上,根据目标色温值的坐标点与实际求得的坐标点的关系,对目标白平衡增益值进行微调,能够进一步提高精准度。
在一示例性实施例中,如图10所示,图10示例性地示出了步骤S103中根据灰度图和暗通道图,确定初始图像中的白点区域的方法流程图:
步骤S1001,确定初始图像的每个像素的RGB三个通道对应的像素值;
步骤S1002,根据RGB三个通道对应的像素值,确定暗通道图中每个像素对应的暗通道值;
步骤S1003,确定初始图像的每个像素对应的灰度值;
步骤S1004,根据暗通道值和灰度值,确定白点区域。
在本公开示例性的实施例中,初始图像中每个像素的坐标记为(i,j),每个像素的RGB三个通道对应的像素值分别记为I R(i,j)、I G(i,j)和I B(i,j),将三个通道对应的像素值的最小值作为暗通道值,则暗通道值即为I d=min(I R(i,j),I G(i,j),I B(i,j))。初始图像的每个像素对应的灰度值可以用任意一种灰度图转换算法计算得到,例如使用平均值法,每个像素的灰度值为I g=(I R(i,j)+I G(i,j)+I B(i,j))/3。图11是根据一示例性实施例示出的暗通道图和灰度图的示例图,如图11所示,左侧为暗通道图,右侧为灰度图。根据每个像素的暗 通道值和灰度值,确定出初始图像的白点区域。
本公开示例性的实施例中,通过灰度图和暗通道图确定白点区域,能够提高对白点区域识别的准确性。
在一示例性实施例中,如图12所示,图12示例性地示出了步骤S1004中根据暗通道值和灰度值,确定白点区域的方法流程图:
步骤S1201,确定暗通道值大于第一预设阈值的初始图像中的第一区域;
步骤S1202,确定灰度值大于第二预设阈值小于第三预设阈值的初始图像中的第二区域;
步骤S1203,将第一区域和第二区域之间的交集确定为初始图像中的白点区域。
在本公开示例性的实施例中,为了获得适当的白点区域,可以选取暗通道值大于第一预设阈值的初始图像中的第一区域,灰度值大于第二预设阈值小于第三预设阈值的初始图像中的第二区域,取第一区域和第二区域之间的交集为初始图像中的白点区域。
在图像获取装置进行图像拍摄时,由于拍摄环境不同,初始图像的特征也不同,第一预设阈值也会有所不同。第一预设阈值可以根据自适应阈值确定方法确定,例如使用最大类间方差法计算得出,图13是根据一示例性实施例示出的进行阈值分割之后的示例图。
为了去除初始图像中过暗区域和过亮区域,可以设定第二预设阈值和第三预设阈值。灰度值小于第二预设阈值为初始图像中过暗的区域,灰度值大于第三预设阈值的区域为初始图像中过亮的区域,第二预设阈值和第三预设阈值之间的灰度值对应的初始图像的区域作为第二区域,第二区域为初始图像中不包括过暗和过亮的区域。第二预设阈值和第三预设阈值为经验值,可以实际需求设定。可选的,第二预设阈值可以为5,第三预设阈值可以为230。本公开示例性的实施例中,将第一区域和第二区域之间的交集确定为初始图像中的白点区域,能够充分考虑初始图像中的像素值情况,使得所得到的白点区域更准确。
在本公开示例性的实施例中所提供的图像的处理方法,相比于现有技术,在色准上有了进一步提升,处理后的图像与标准图像求得的色差更小,白平衡效果更好,在人眼主观评价上也优于现有技术。
在一示例性中,在关闭相机白平衡的情况下,拍摄室外随机500张图片和室内500张图片作为实验数据,分别对其使用本公开中提供的图像处理方法进行颜色校正,得到处理后的图像。再通过人工手动白平衡的方式得到符合人眼感官的标准图像。通过色差公式CIE 2000计算使用本公开中的方法处理得到的图像与标准图像的色差,以及现有技术中的白平衡算法处理得到的图像与标准图像的色差,现有技术中的白平衡算法使用灰度世界算法(GW算法)、WPR(White Patch Retinex)算法和暗通道先验算法,得出如表1所示的数据:
表1
  GW算法 WPR算法 暗通道先验算法 本公开中的方法
室内500张图片 21.13 23.02 16.44 9.31
室外500张图片 12.32 16.23 9.38 5.29
根据表1中的数据,可以看出本公开中的图像处理方法所得到的图像与标准图像的色差最小。图14是根据一示例性的实施例示出本公开图像处理方法处理后得到的图像示例图,如图14所示,a列和c列为获取的初始图像,b列和d列为处理后的图像,可以看出处理后的图像白平衡效果较好。
本公开示例性的实施例中,提供一种图像的处理装置,应用于图像获取装置,图15是根据一示例性实施例示出的一种图像的处理装置框图:
获取模块1501,被配置为获取所述图像获取装置所获取的初始图像;
第一确定模块1502,被配置为根据所述初始图像确定对应的灰度图和暗通道图;
第二确定模块1503,被配置为根据所述灰度图和所述暗通道图,确定所述初始图像中的白点区域;
第三确定模块1504,被配置为根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
本公开示例性的实施例中,能够更加准确的找出白点区域,并准确得出用于白平衡调节的目标白平衡增益值,使得白平衡调节后的图像的显示效果更好。
在一示例性实施例中,所述第三确定模块1504还被配置为:
确定所述白点区域中每个像素点的白平衡增益值;
根据所述每个像素点的白平衡增益值,确定所述白点区域的白平衡增益值;
根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
在一示例性实施例中,所述第三确定模块1504还被配置为:
确定所述白点区域中每个像素点对应的与曝光指数相关的第一色温权重以及与颜色直方图相关的第二色温权重;
根据所述每个像素点的像素值以及所述第一色温权重和所述第二色温权重,确定所述白点区域的白平衡增益值。
在一示例性实施例中,所述第三确定模块1504还被配置为:
根据所述曝光指数将所述初始图像划分为多个曝光区间;
将每个所述曝光区间,按照色温划分为多个色温区间;
根据所述白点区域中每个像素点所在的色温区间,确定所述白点区域中每个像素点的所述第一色温权重。
在一示例性实施例中,所述第三确定模块1504还被配置为:
确定所述白点区域中所有像素点的个数以及每个像素点所在的所述色温区间;
针对每个所述色温区间,将所述色温区间内像素点的个数占所述所有像素点的个数的比例确定为第一初始色温权重;
根据环境光信息,调整第一初始色温权重,确定所述第一色温权重。
在一示例性实施例中,所述第三确定模块1504还被配置为:
根据所述曝光指数将所述初始图像划分为多个曝光区间;
将每个所述曝光区间,按照色温划分为多个色温区间;
根据白平衡增益值与色温的对应关系,确定每个所述色温区间的平均白平衡增益值;
根据所述平均白平衡增益值,对所述白点区域中处于各个所述色温区间的像素点进行增益,得到所述白点区域增益后的每个所述色温区间的RGB值;
根据增益后的每个所述色温区间的RGB值,确定每个色温区间的所述第二色温权重。
在一示例性实施例中,所述第三确定模块1504还被配置为:
根据增益后的每个所述色温区间的RGB值,确定每个所述色温区间的R通道、G通道和B通道的三通道直方图;
确定所述每个所述色温区间的R通道、G通道和B通道的三通道直方图中的三个通道的重合面积;
根据每个所述色温区间内的所述重合面积,确定每个所述色温区间的所述第二色温权重。
在一示例性实施例中,根据色温值的大小,处于中间位置的色温区间的大小小于处于两端位置的色温区间的大小。
在一示例性实施例中,第三确定模块1504还被配置为:
选择所述白平衡增益值和所述色温值的对应关系中,与所述白点区域的白平衡增益值对应的坐标的距离最小的坐标所对应的白平衡增益值作为目标白平衡增益值,对应的色温值作为目标色温值。
在一示例性实施例中,所述装置还包括:
调整模块1505,被配置为根据所述白点区域的色温值和所述目标色温值的关系,对目标白平衡增益值进行调整。
在一示例性实施例中,所述第二确定模块1503还被配置为:
确定所述初始图像的每个像素的RGB三个通道对应的像素值;
根据所述RGB三个通道对应的像素值,确定暗通道图中每个像素对应的暗通道值;
确定所述初始图像的每个像素对应的灰度值;
根据所述暗通道值和所述灰度值,确定所述白点区域。
在一示例性实施例中,所述第二确定模块1503还被配置为:
确定暗通道值大于第一预设阈值的所述初始图像中的第一区域;
确定所述灰度值大于第二预设阈值小于第三预设阈值的所述初始图像中的第二区域;
将所述第一区域和所述第二区域之间的交集确定为所述初始图像中的白点区域。
在一示例性实施例中,所述装置还包括标定模块1506,被配置为:
在不同给定色温值下,获取预设灰度值的灰色目标对象的多张参考图像;
针对每张参考图像,将所有像素点的像素值的平均值作为每张所述参考图像的像素值;
根据所述参考图像的像素值,确定所述参考图像对应的白平衡增益值;
根据所述白平衡增益值和所述给定色温值,确定所述白平衡增益值和所述色温值的对应关系。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
当图像获取装置为终端时,图16是根据一示例性实施例示出的一种用于图像的处理装置1600的框图。例如,装置1600可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。
参照图16,装置1600可以包括以下一个或多个组件:处理组件1602,存储器1604,电源组件1606,多媒体组件1608,音频组件1610,输入/输出(I/O)的接口1612,传感器组件1614,以及通信组件1616。
处理组件1602通常控制装置1600的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件1602可以包括一个或多个处理器1620来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件1602可以包括一个或多个模块,便于处理组件1602和其他组件之间的交互。例如,处理组件1602可以包括多媒体模块,以方便多媒体组件1608和处理组件1602之间的交互。
存储器1604被配置为存储各种类型的数据以支持在设备1600的操作。这些数据的示例包括用于在装置1600上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息, 图片,视频等。存储器1604可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件1606为装置1600的各种组件提供电力。电源组件1606可以包括电源管理系统,一个或多个电源,及其他与为装置1600生成、管理和分配电力相关联的组件。
多媒体组件1608包括在所述装置1600和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件1608包括一个前置摄像头和/或后置摄像头。当设备1600处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件1610被配置为输出和/或输入音频信号。例如,音频组件1610包括一个麦克风(MIC),当装置1600处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器1604或经由通信组件1616发送。在一些实施例中,音频组件1610还包括一个扬声器,用于输出音频信号。
I/O接口1612为处理组件1602和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件1614包括一个或多个传感器,用于为装置1600提供各个方面的状态评估。例如,传感器组件1614可以检测到设备1600的打开/关闭状态,组件的相对定位,例如所述组件为装置1600的显示器和小键盘,传感器组件1614还可以检测装置1600或装置1600一个组件的位置改变,用户与装置1600接触的存在或不存在,装置1600方位或加速/减速和装置1600的温度变化。传感器组件1614可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件1614还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件1614还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件1616被配置为便于装置1600和其他设备之间有线或无线方式的通信。装置 1600可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件1616经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件1616还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,装置1600可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器1604,上述指令可由装置1600的处理器1620执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
一种非临时性计算机可读存储介质,当所述存储介质中的指令由装置的处理器执行时,使得装置能够执行一种图像的处理方法,所述方法包括上述的任一方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。
工业实用性
本文中的方法能够更加准确的找出白点区域,并准确得出用于白平衡调节的目标白平衡增益值,使得白平衡调节后的图像的显示效果更好。

Claims (16)

  1. 一种图像的处理方法,应用于图像获取装置,所述方法包括:
    获取所述图像获取装置所获取的初始图像;
    根据所述初始图像确定对应的灰度图和暗通道图;
    根据所述灰度图和所述暗通道图,确定所述初始图像中的白点区域;
    根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
  2. 根据权利要求1所述的图像的处理方法,其中,所述根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值,包括:
    确定所述白点区域中每个像素点的白平衡增益值;
    根据所述每个像素点的白平衡增益值,确定所述白点区域的白平衡增益值;
    根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
  3. 根据权利要求2所述的图像的处理方法,其中,所述根据所述每个像素点的白平衡增益值,确定所述白点区域的白平衡增益值,包括:
    确定所述白点区域中每个像素点对应的与曝光指数相关的第一色温权重以及与颜色直方图相关的第二色温权重;
    根据所述每个像素点的像素值以及所述第一色温权重和所述第二色温权重,确定所述白点区域的白平衡增益值。
  4. 根据权利要求3所述的图像的处理方法,其中,确定所述白点区域中每个像素点对应的与曝光指数相关的第一色温权重,包括:
    根据所述曝光指数将所述初始图像划分为多个曝光区间;
    将每个所述曝光区间,按照色温划分为多个色温区间;
    根据所述白点区域中每个像素点所在的色温区间,确定所述白点区域中每个像素点的所述第一色温权重。
  5. 根据权利要求4所述的图像的处理方法,其中,所述根据所述白点区域中每个像素点所在的色温区间,确定所述第一色温权重,包括:
    确定所述白点区域中所有像素点的个数以及每个像素点所在的所述色温区间;
    针对每个所述色温区间,将所述色温区间内像素点的个数占所述所有像素点的个数的比 例确定为第一初始色温权重;
    根据环境光信息,调整第一初始色温权重,确定所述第一色温权重。
  6. 根据权利要求3所述的图像的处理方法,其中,确定所述白点区域中每个像素点对应的与颜色直方图相关的第二色温权重,包括:
    根据所述曝光指数将所述初始图像划分为多个曝光区间;
    将每个所述曝光区间,按照色温划分为多个色温区间;
    根据白平衡增益值与色温的对应关系,确定每个所述色温区间的平均白平衡增益值;
    根据所述平均白平衡增益值,对所述白点区域中处于各个所述色温区间的像素点进行增益,得到所述白点区域增益后的每个所述色温区间的RGB值;
    根据增益后的每个所述色温区间的RGB值,确定每个色温区间的所述第二色温权重。
  7. 根据权利要求6所述的图像的处理方法,其中,所述根据增益后的每个所述色温区间的RGB值,确定每个色温区间的第二色温权重,包括:
    根据增益后的每个所述色温区间的RGB值,确定每个所述色温区间的R通道、G通道和B通道的三通道直方图;
    确定所述每个所述色温区间的R通道、G通道和B通道的三通道直方图中的三个通道的重合面积;
    根据每个所述色温区间内的所述重合面积,确定每个所述色温区间的所述第二色温权重。
  8. 根据权利要求4或6所述的图像的处理方法,其中,根据色温值的大小,处于中间位置的色温区间的大小小于处于两端位置的色温区间的大小。
  9. 根据权利要求1-8任一所述的图像的处理方法,其中,根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值,包括:
    选择所述白平衡增益值和所述色温值的对应关系中,与所述白点区域的白平衡增益值对应的坐标的距离最小的坐标所对应的白平衡增益值作为目标白平衡增益值,对应的色温值作为目标色温值。
  10. 根据权利要求9所述的图像的处理方法,所述方法还包括:
    根据所述白点区域的色温值和所述目标色温值的关系,对目标白平衡增益值进行调整。
  11. 根据权利要求1所述的图像的处理方法,其中,根据所述灰度图和所述暗通道图,确定所述初始图像中的白点区域,包括:
    确定所述初始图像的每个像素的RGB三个通道对应的像素值;
    根据所述RGB三个通道对应的像素值,确定暗通道图中每个像素对应的暗通道值;
    确定所述初始图像的每个像素对应的灰度值;
    根据所述暗通道值和所述灰度值,确定所述白点区域。
  12. 根据权利要求11所述的图像的处理方法,其中,根据所述暗通道值和所述灰度值,确定所述白点区域,包括:
    确定暗通道值大于第一预设阈值的所述初始图像中的第一区域;
    确定所述灰度值大于第二预设阈值小于第三预设阈值的所述初始图像中的第二区域;
    将所述第一区域和所述第二区域之间的交集确定为所述初始图像中的白点区域。
  13. 根据权利要求1所述的图像的处理方法,所述方法还包括:
    在不同给定色温值下,获取预设灰度值的灰色目标对象的多张参考图像;
    针对每张参考图像,将所有像素点的像素值的平均值作为每张所述参考图像的像素值;
    根据所述参考图像的像素值,确定所述参考图像对应的白平衡增益值;
    根据所述白平衡增益值和所述给定色温值,确定所述白平衡增益值和所述色温值的对应关系。
  14. 一种图像的处理装置,应用于图像获取装置,所述装置包括:
    获取模块,被配置为获取所述图像获取装置所获取的初始图像;
    第一确定模块,被配置为根据所述初始图像确定对应的灰度图和暗通道图;
    第二确定模块,被配置为根据所述灰度图和所述暗通道图,确定所述初始图像中的白点区域;
    第三确定模块,被配置为根据白平衡增益值与色温的对应关系以及所述白点区域的白平衡增益值,确定用于白平衡调节的目标色温值和目标白平衡增益值。
  15. 一种图像获取装置,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为执行如权利要求1-13任一项所述的方法。
  16. 一种非临时性计算机可读存储介质,当所述存储介质中的指令由装置的处理器执行时,使得装置能够执行如权利要求1-13任一项所述的方法。
PCT/CN2022/098665 2022-06-14 2022-06-14 一种图像的处理方法、装置及存储介质 WO2023240444A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2022/098665 WO2023240444A1 (zh) 2022-06-14 2022-06-14 一种图像的处理方法、装置及存储介质
CN202280004379.6A CN117616774A (zh) 2022-06-14 2022-06-14 图像的处理方法、装置及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/098665 WO2023240444A1 (zh) 2022-06-14 2022-06-14 一种图像的处理方法、装置及存储介质

Publications (1)

Publication Number Publication Date
WO2023240444A1 true WO2023240444A1 (zh) 2023-12-21

Family

ID=89192935

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/098665 WO2023240444A1 (zh) 2022-06-14 2022-06-14 一种图像的处理方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN117616774A (zh)
WO (1) WO2023240444A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004320671A (ja) * 2003-04-21 2004-11-11 Sony Corp ホワイトバランス調整装置、ホワイトバランス調整方法
KR20140124985A (ko) * 2013-04-17 2014-10-28 중앙대학교 산학협력단 자동 백광 조정을 위한 다크 채널 프라이어 기반의 백색 영역 추정 장치 및 방법
CN105554489A (zh) * 2015-07-10 2016-05-04 宇龙计算机通信科技(深圳)有限公司 一种白平衡调整方法和拍摄终端
CN105681775A (zh) * 2016-03-08 2016-06-15 福州瑞芯微电子股份有限公司 一种白平衡方法和装置
CN107360410A (zh) * 2017-07-10 2017-11-17 广东欧珀移动通信有限公司 白平衡控制方法、装置和终端设备
CN107483909A (zh) * 2017-10-11 2017-12-15 凌云光技术集团有限责任公司 白平衡处理方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004320671A (ja) * 2003-04-21 2004-11-11 Sony Corp ホワイトバランス調整装置、ホワイトバランス調整方法
KR20140124985A (ko) * 2013-04-17 2014-10-28 중앙대학교 산학협력단 자동 백광 조정을 위한 다크 채널 프라이어 기반의 백색 영역 추정 장치 및 방법
CN105554489A (zh) * 2015-07-10 2016-05-04 宇龙计算机通信科技(深圳)有限公司 一种白平衡调整方法和拍摄终端
CN105681775A (zh) * 2016-03-08 2016-06-15 福州瑞芯微电子股份有限公司 一种白平衡方法和装置
CN107360410A (zh) * 2017-07-10 2017-11-17 广东欧珀移动通信有限公司 白平衡控制方法、装置和终端设备
CN107483909A (zh) * 2017-10-11 2017-12-15 凌云光技术集团有限责任公司 白平衡处理方法和装置

Also Published As

Publication number Publication date
CN117616774A (zh) 2024-02-27

Similar Documents

Publication Publication Date Title
WO2018171493A1 (zh) 图像处理方法、装置及存储介质
CN109345485B (zh) 一种图像增强方法、装置、电子设备及存储介质
CN107438163B (zh) 一种拍照方法、终端及计算机可读存储介质
WO2016011747A1 (zh) 肤色调整方法和装置
CN110958401B (zh) 一种超级夜景图像颜色校正方法、装置和电子设备
CN108470322B (zh) 处理人脸图像的方法、装置及可读存储介质
CN106651777B (zh) 图像处理方法及装置、电子设备
CN107967459B (zh) 卷积处理方法、装置及存储介质
CN108932696B (zh) 信号灯的光晕抑制方法及装置
US11783450B2 (en) Method and device for image processing, terminal device and storage medium
CN111625213A (zh) 画面显示方法、装置和存储介质
US11222235B2 (en) Method and apparatus for training image processing model, and storage medium
CN107564047B (zh) 图像处理方法及装置、电子设备和计算机可读存储介质
CN105472228B (zh) 图像处理方法、装置及终端
CN104536713B (zh) 显示图像中的字符的方法及装置
CN107239758B (zh) 人脸关键点定位的方法及装置
CN115526774A (zh) 图像插值方法、装置、存储介质及电子设备
CN114827391A (zh) 摄像头切换方法、摄像头切换装置及存储介质
WO2023240444A1 (zh) 一种图像的处理方法、装置及存储介质
US11749228B2 (en) Method and device for adjusting display brightness of screen, and storage medium
CN116363148B (zh) 图像处理方法、装置、芯片及存储介质
WO2023231009A1 (zh) 一种对焦方法、装置及存储介质
US11527219B2 (en) Method and apparatus for processing brightness of display screen
CN114339187B (zh) 图像处理方法、图像处理装置及存储介质
CN115619879A (zh) 图像处理方法、装置、存储介质及电子设备

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202280004379.6

Country of ref document: CN