Package boofcv.alg.color
Class ColorLab
- java.lang.Object
-
- boofcv.alg.color.ColorLab
-
public class ColorLab extends java.lang.ObjectConversion between RGB and CIE LAB color space. LAB color is designed to approximate human vision. L for lightness and a and b for the color-opponent dimensions, The reference white used in the conversions below is D65.
Note:
- L has a range of 0 to 100
- L = 0 is black and L* = 100 is diffuse white
- See Also:
ColorXyz
-
-
Constructor Summary
Constructors Constructor Description ColorLab()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleinvTran(double t)static floatinvTran(float t)static voidlabToLinearRgb(double L, double a, double b, double[] linearRgb)Conversion from CEI LAB to gamma corrected linear RGB.static voidlabToLinearRgb(float L, float a, float b, float[] linearRgb)Conversion from CEI LAB to gamma corrected linear RGB.static voidlabToRgb(double L, double a, double b, double[] linearRgb, int[] rgb)Conversion of CEI LAB to 8-bit RGB.static voidlabToRgb(float L, float a, float b, float[] linearRgb, float[] rgb)Conversion of CEI LAB to 8-bit RGB.static voidlabToRgb(float L, float a, float b, float[] linearRgb, int[] rgb)Conversion of CEI LAB to 8-bit RGB.static <T extends boofcv.struct.image.ImageGray<T>>
voidlabToRgb(boofcv.struct.image.Planar<boofcv.struct.image.GrayF32> lab, boofcv.struct.image.Planar<T> rgb)Convert a 3-channelPlanarimage from LAB into RGB.static voidlabToXyz(double L, double a, double b, double[] xyz)Convert CEI LAB to CEI XYZ color spacestatic voidlabToXyz(float L, float a, float b, float[] xyz)Convert CEI LAB to CEI XYZ color spacestatic voidlinearRgbToLab(double r, double g, double b, double[] lab)Conversion from gamma corrected linear RGB into CEI LAB.static voidlinearRgbToLab(float r, float g, float b, float[] lab)Conversion from gamma corrected linear RGB into LAB.static voidrgbToLab(double r, double g, double b, float[] lab)Conversion from 8-bit RGB into CIE LAB.static voidrgbToLab(int r, int g, int b, double[] lab)Conversion from 8-bit RGB into CIE LAB.static voidrgbToLab(int r, int g, int b, float[] lab)Conversion from 8-bit RGB into CIE LAB.static <T extends boofcv.struct.image.ImageGray<T>>
voidrgbToLab(boofcv.struct.image.Planar<T> rgb, boofcv.struct.image.Planar<boofcv.struct.image.GrayF32> lab)Convert a 3-channelPlanarimage from RGB into LAB.static voidxyzToLab(double X, double Y, double Z, double[] lab)Convert CEI XYZ to CEI LAB color spacestatic voidxyzToLab(float X, float Y, float Z, float[] lab)Convert CEI XYZ to CEI LAB color space
-
-
-
Field Detail
-
epsilon
public static final double epsilon
- See Also:
- Constant Field Values
-
kappa
public static final double kappa
- See Also:
- Constant Field Values
-
Xr
public static final double Xr
- See Also:
- Constant Field Values
-
Yr
public static final double Yr
- See Also:
- Constant Field Values
-
Zr
public static final double Zr
- See Also:
- Constant Field Values
-
epsilon_f
public static final float epsilon_f
- See Also:
- Constant Field Values
-
kappa_f
public static final float kappa_f
- See Also:
- Constant Field Values
-
Xr_f
public static final float Xr_f
- See Also:
- Constant Field Values
-
Yr_f
public static final float Yr_f
- See Also:
- Constant Field Values
-
Zr_f
public static final float Zr_f
- See Also:
- Constant Field Values
-
-
Method Detail
-
rgbToLab
public static void rgbToLab(int r, int g, int b, double[] lab)Conversion from 8-bit RGB into CIE LAB. 8-bit = range of 0 to 255.
-
rgbToLab
public static void rgbToLab(int r, int g, int b, float[] lab)Conversion from 8-bit RGB into CIE LAB. 8-bit = range of 0 to 255.
-
rgbToLab
public static void rgbToLab(double r, double g, double b, float[] lab)Conversion from 8-bit RGB into CIE LAB. 8-bit = range of 0 to 255.
-
labToRgb
public static void labToRgb(double L, double a, double b, double[] linearRgb, int[] rgb)Conversion of CEI LAB to 8-bit RGB. Converts to linearRgb and then applies gamma correction.- Parameters:
linearRgb- (output) Workspace to store intermediate linearRgb resultsrgb- (output) 8-bit RGB color. 0 to 255
-
labToRgb
public static void labToRgb(float L, float a, float b, float[] linearRgb, int[] rgb)Conversion of CEI LAB to 8-bit RGB. Converts to Linear RGB and then applies gamma correction.- Parameters:
linearRgb- (output) Workspace to store intermediate linearRgb resultsrgb- (output) 8-bit RGB color. 0 to 255
-
labToRgb
public static void labToRgb(float L, float a, float b, float[] linearRgb, float[] rgb)Conversion of CEI LAB to 8-bit RGB. Converts to Linear RGB and then applies gamma correction.- Parameters:
linearRgb- (output) Workspace to store intermediate Linear RGB resultsrgb- (output) 8-bit RGB color. 0 to 255
-
labToLinearRgb
public static void labToLinearRgb(float L, float a, float b, float[] linearRgb)Conversion from CEI LAB to gamma corrected linear RGB. Linear RGB values have a range of 0:1
-
labToLinearRgb
public static void labToLinearRgb(double L, double a, double b, double[] linearRgb)Conversion from CEI LAB to gamma corrected linear RGB. Linear RGB values have a range of 0:1
-
xyzToLab
public static void xyzToLab(double X, double Y, double Z, double[] lab)Convert CEI XYZ to CEI LAB color space
-
xyzToLab
public static void xyzToLab(float X, float Y, float Z, float[] lab)Convert CEI XYZ to CEI LAB color space
-
labToXyz
public static void labToXyz(double L, double a, double b, double[] xyz)Convert CEI LAB to CEI XYZ color space
-
labToXyz
public static void labToXyz(float L, float a, float b, float[] xyz)Convert CEI LAB to CEI XYZ color space
-
invTran
public static double invTran(double t)
-
invTran
public static float invTran(float t)
-
linearRgbToLab
public static void linearRgbToLab(double r, double g, double b, double[] lab)Conversion from gamma corrected linear RGB into CEI LAB. Normalized RGB values have a range of 0:1
-
linearRgbToLab
public static void linearRgbToLab(float r, float g, float b, float[] lab)Conversion from gamma corrected linear RGB into LAB. Normalized RGB values have a range of 0:1
-
rgbToLab
public static <T extends boofcv.struct.image.ImageGray<T>> void rgbToLab(boofcv.struct.image.Planar<T> rgb, boofcv.struct.image.Planar<boofcv.struct.image.GrayF32> lab)Convert a 3-channelPlanarimage from RGB into LAB. RGB is assumed to have a range from 0:255 NOTE: Input and output image can be the same instance.- Parameters:
rgb- (Input) 8-bit RGB encoded image. R = channel 0, G = channel 1, B = channel 2lab- (Output) LAB encoded image. L = channel 0, A = channel 1, B = channel 2
-
labToRgb
public static <T extends boofcv.struct.image.ImageGray<T>> void labToRgb(boofcv.struct.image.Planar<boofcv.struct.image.GrayF32> lab, boofcv.struct.image.Planar<T> rgb)Convert a 3-channelPlanarimage from LAB into RGB. RGB will have a range from 0 to 255. NOTE: Input and output image can be the same instance.- Parameters:
lab- (Input) LAB encoded image. L = channel 0, A = channel 1, B = channel 2rgb- (Output) 8-bit RGB encoded image. R = channel 0, G = channel 1, B = channel 2
-
-