Ping Lu,Xia Jia,and Tirui Wu
(Pre-Research Department of ZTECorporation,Nanjing210012,China)
Abstract AB-chromaticity histogram analysis works well most of the time,but it may not work well when the color cast is not severe.To overcome this problem,we propose an improved,two-step automatic cast-detection method.First,we compute the RGB color variance to evaluate the quality of the input image.If this variance is very small,we extract near-neutral color areas and compute the local ab-chromaticity histogram.We use this local ab-chromaticity histogram to evaluate the quality of the input image.This method has been tested in ZTE's video surveillance system.The results show that the proposed method produces better results based on subjective evaluation and is more efficient in various conditions.
Keyw ords color cast;AB-chromaticity histogram;near-neutral color areas
M any image processing algorithms are currently in use thanks to the Internet and the growing popularity of smart devices.Because of the differences between human eyes and digital camera lenses,it is necessary to develop techniques for automatic focusing,exposure,color adjustment,and white balance in order to improvethequalitiy of color in captured images.
A number of color-adjustment algorithms have been proposed in the literature.The most widely used of these algorithms is white balance,which adjusts color cast caused by light sources.There are two categories of white balance algorithm:gray world assumption[1]and max white[2].Gray world assumption calculates weighting values for color correction by matching the color average with a gray reference value.However,the algorithm may fail if the image only contains a few color elements.Max white derives weighting values for color correction by changing the white point in the image to a white referencepoint.It failsif thewhitepoint isnot found in theimage.
There are also a number of other methods for color adjustment.For example,neural networks can be used to determine the type of illuminant and to correct images after a vast amount of illuminant data has been collected[3].In the color-by-correlation method,illuminant data is first collected in order to set up a correlation matrix that is used to determine the type of illuminant and correct the image[4].In the illuminant voting method,a probability and voting process is used to determine the type of illuminant[5].The neural network,color-by-correlation,and illuminant-voting methods are all complicated becausethey requireheavy computation in advance.
Color-cast detection protects images without color cast before the white balance algorithm is applied.In[6],the nonlinear classification function of a neural network is used to classify the input images as real cast,no cast,or intrinsic cast.The neural network uses seven features for detecting real cast and no cast and six featuresfor detectingintrinsic cast.Other methods include the threshold method[7]and histogram method[8]-[10].Color-cast detection methodscan beused when
·images uploaded to or downloaded from the internet have color cast
·images have color cast caused by improperly adjusting the automatic whitebalancein thedigital camera
·images have color cast from other devices,such as scanners
or monitors·old and stained photosarerecaptured by adigital camera·images have uncertain color cast.
In[11],a very effective method was proposed to detect color cast in images.The method is based on the assumption that when there is more color cast in an image,the distribution of the ab-chromaticity histogram is more centralized.Fig.1(a)shows an image that has color cast,and Fig.1(b)is the corresponding ab-chromaticity histogram.The distribution of the histogram is extremely centralized.This method works well most of the time,but it may not be suitable when the color cast is not severe.When evaluated over the entire image,the subjective assessment index may become very small because of dilution,and this leads to misclassification.To overcome this problem and evaluate the input image,we propose a method based on the local ab-chromaticity histogram of the near-neutral regionsof theimage.
There are two basic types of color cast:intrinsic,which is caused by a dominant color such as sky blue;and real,which is caused by the failure of the capturing device or by unusual lighting conditions.These two types of color cast are difficult to distinguish,so we simply treat them both as color cast.Here,we briefly describe the original ab-chromaticity histogrammethod[11].
▲Figure1.(a)An imagewith color cast and(b)thecorresponding ab-chromaticity histogram.
Most color images are represented in the RGB color space;that is,a color image comprises a red channel,a green channel,and a blue channel.However,the RGB color space is not suitable for image proccesing because the correlations between the three channels are large,and the three channels contain a large amount of redundant information.Therefore,the original ab-chromaticity histogram method is used in the Lab color space.Compared with the RGB color space,the Lab color space has some useful attributes that help us detect color cast.The more color cast in the image,the more centralized the distribution of the ab-chromaticity histogram.In the original method,RGB is converted to Lab color;then,the 2D ab-chromaticity histogram Habis computed.Once this histogram has been computed,the following equation is used to provide statisticsthat help us analyze the histogram:
where k=a,b(channel);μkis the mean levels of chromaticity in channels a and b;andσkis the variance of the ab-chromaticity histogramalongtheaxis a and b,respectively.
Because a histogram is not an intuitive way to display the statistics from(1),we can use an equivalent circle.The center of the circle is(μa,μb),the radius isσ=σa2+σb2.We can define the minimum distance between the circle and the center of the ab-chromaticity plane(a=0,b=0)as
whereμ=μa2+μb2.Then,we compute the color-cast coefficient(CCC):
Because d measures how far the whole histogram lies from the neutral axis(a=0,b=0)andσis the spread of the histogram,dσcan be used to quantify the strength of the cast.
AB-chromacity histogram analysis may not work well when the color cast is not severe.To overcome this problem,we use the local ab-chromaticity of neural regions(defined in section 2.2.1)rather than the ab-chromaticity histogram of the whole image to evaluate the image quality.Furthermore,in order to speed up our method,we add an initial decision step.Fig.2 showstheflow,which can besummarized follows:
Input:color image
Output:Boolean value(to indicate whether color cast exists or not)
Procedure:
2.If theσRGBissmaller than a predefined threshold TσRGB,go to step 3,else return false.
3.Convert the input image from RGB color space to Lab color space.
4.Extract near-netural regions
5.Computelocal-CCCusingequations(1)-(3).
6.If local-CCC greater than predefined threshold Tlocal-CCC,return true,else return true.
2.2.1 Extraction of Near-Neutral Regions
We propose using the local-CCCof near-neutral regions as the subjective color-cast index.We define a near-neutral region as pixels that have an ab-chromatictiy valuenear the center of the ab-chromacity plane;that is,the pixels are grayless.Fig.3 shows some experiemental results for extraction of near-neutral regions.
▲Figure2.Flow of theproposed method.
In our experiments,TσRGB=30 and Tlocal-CCC=0.Fig.4 shows some results from the experiments.The left column shows the input image;the middle column shows the equivalent circle of the global ab-chromaticity histogram;and the right column is the equivalent circle of the local ab-chromaticity histogram.When there is no color cast,the difference between global CCC dσgand local CCC dσlis small.In Fig.3(a),abs(dσg-dσl)=0.0206(nearly zero).However,when ther is color cast,the difference between dσgand dσlislarger.In Fig3(b),(c)and(d),the differences between dσgand dσlare 0.6137,2.459,and 5.4975,respectively.That is,if there is color cast,the difference between the global CCCand local CCCincreases.Local CCCis a more distinguishable subjective index for color-cast evaluation.
◀Figure3.Extraction of near-neutral regions.Left:input image;right:near-neutral region.
In this paper,we have proposed an improved color-cast detection method in which local CCC of near-neutral regions is used to evaluate the input image and determine whether color cast exists in that image.Our method can overcome the limitations of using the ab-chromaticity histogram method when the input image does not have severe color cast.This method has been used in ZTE's video surveillance system to evaluate video quality and is effective in a range of environments.
▲Figure4.Experiental resultsfor theproposed method.