Class WhiteBalance
WhiteBalance.
References:
[Ken09] Kenfack, Pierre Marie (2009). Implementierung und Vergleich
verschiedener Algorithmen zur Bildsensorkalibrierung. Fraunhofer ITWM.
Diplomarbeit_Kenfack.pdf
[Lam05] Edmund Lam, Combining gray world and retinex theory for automatic white balance in digital photography, Consumer Electronics, 2005. (ISCE 2005). Proceedings of the Ninth International Symposium on (2005), pp.134–139.
[Huo05] Huo Yun-yan, Chang Yi-lin, Wang Jing, Wei Xiao-xia. (2005). Robust Automatic White Balance Algorithm using Gray Color Points in Images.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImagePerforms white balance adjustment using the "grey world" assumption as described in [Ken09].static double[]whiteBalanceGreyworld(Histogram rgbHist) Computes the white balance of an image using the Greyworld algorithm.static BufferedImagewhiteBalanceGreyworldYCC(BufferedImage img, float[] ccAdjust, boolean all) Performs white balance adjustment using the "grey world" assumption as described in [Huo05], but using the YCbCr color space instead of YUV.static BufferedImagewhiteBalanceGreyworldYUV(BufferedImage img, float[] uvAdjust, boolean all) Performs white balance adjustment using the "grey world" assumption as described in [Huo05].static double[]whiteBalanceQM(long[][] rgbBins) static BufferedImagestatic double[]whiteBalanceQM(Histogram rgbHist) Computes the white balance of an image using the Quadratic Mapping (QM) algorithm.static BufferedImagestatic double[]whiteBalanceRetinex(Histogram rgbHist) Computes the white balance of an image using the Retinex algorithm.
-
Method Details
-
whiteBalanceGreyworld
Performs white balance adjustment using the "grey world" assumption as described in [Ken09]. -
whiteBalanceGreyworldYCC
public static BufferedImage whiteBalanceGreyworldYCC(BufferedImage img, float[] ccAdjust, boolean all) Performs white balance adjustment using the "grey world" assumption as described in [Huo05], but using the YCbCr color space instead of YUV. -
whiteBalanceGreyworldYUV
public static BufferedImage whiteBalanceGreyworldYUV(BufferedImage img, float[] uvAdjust, boolean all) Performs white balance adjustment using the "grey world" assumption as described in [Huo05]. -
whiteBalanceRetinex
-
whiteBalanceQM
-
whiteBalanceGreyworld
Computes the white balance of an image using the Greyworld algorithm.The Greyworld algorithm assumes that the average color of an image should be a neutral gray: avg(R)=avg(G)=avg(B).
References:
Edmund Lam, Combining gray world and retinex theory for automatic white balance in digital photography, Consumer Electronics, 2005. (ISCE 2005). Proceedings of the Ninth International Symposium on (2005), pp.134–139.Kenfack, Pierre Marie. (2009). Implementierung und Vergleich verschiedener Algorithmen zur Bildsensorkalibrierung. Fraunhofer ITWM. http://www.itwm.fraunhofer.de/fileadmin/ITWM
- Parameters:
rgbHist-- Returns:
- a 3x3 matrix which performs the color correction matrix*[R,G,B].
-
whiteBalanceRetinex
Computes the white balance of an image using the Retinex algorithm.References:
Edmund Lam, Combining gray world and retinex theory for automatic white balance in digital photography, Consumer Electronics, 2005. (ISCE 2005). Proceedings of the Ninth International Symposium on (2005), pp.134–139.Kenfack, Pierre Marie. (2009). Implementierung und Vergleich verschiedener Algorithmen zur Bildsensorkalibrierung. Fraunhofer ITWM. http://www.itwm.fraunhofer.de/fileadmin/ITWM
- Parameters:
rgbHist-- Returns:
- a 3x3 matrix which performs the color correction matrix*[R,G,B].
-
whiteBalanceQM
Computes the white balance of an image using the Quadratic Mapping (QM) algorithm. QM is a combination of the Greyworld and the Retinex algorithm. And usually gives better results.References:
Edmund Lam, Combining gray world and retinex theory for automatic white balance in digital photography, Consumer Electronics, 2005. (ISCE 2005). Proceedings of the Ninth International Symposium on (2005), pp.134–139.Kenfack, Pierre Marie. (2009). Implementierung und Vergleich verschiedener Algorithmen zur Bildsensorkalibrierung. Fraunhofer ITWM. http://www.itwm.fraunhofer.de/fileadmin/ITWM
Returns a vector with 4 values: Rmu, Rnu, Bmu, Bnu. These values can be put into a 3x6 matrix as shown below:
[ R G B [R' [ Rnu 0 0 Rmu 0 0 R^2 G' = 0 1 0 0 0 0 * G^2 B'] 0 0 Bnu 0 0 Bmu ] B^2 ]- Parameters:
rgbHist-- Returns:
- a vector with the values {Rmu, Rnu, Bmu, Bnu}.
-
whiteBalanceQM
public static double[] whiteBalanceQM(long[][] rgbBins)
-