public class ColorYuv extends Object
Color conversion between YUV and RGB, and YCbCr and RGB. YUV is color encoding which takes in account a human perception model and is commonly used in cameras/video with analog signals. YCbCr is the digital equivalent color space of YUV that is scaled and offset. YCbCr is also commonly referred to as YUV, even though it is a different format.
Y component encodes luma (B&W gray scale) and U,V encodes color. The same is true for Y,Cb,Cr, respectively. In the functions below, if the input is floating point then YUV is used, otherwise YCbCr is used. How these color formats are encoded varies widely. For YCbCr, Y is "defined to have a nominal 8-bit range of 16-235, Cb and Cr are defined to have a nominal range of 16-240", see [3].
Sources for equations:
| Constructor and Description |
|---|
ColorYuv() |
| Modifier and Type | Method and Description |
|---|---|
static void |
rgbToYCbCr(int r,
int g,
int b,
byte[] yuv)
Conversion from RGB to YCbCr.
|
static void |
rgbToYuv_F32(MultiSpectral<ImageFloat32> rgb,
MultiSpectral<ImageFloat32> yuv)
Convert a 3-channel
MultiSpectral image from RGB into YUV. |
static void |
rgbToYuv(double r,
double g,
double b,
double[] yuv)
Conversion from RGB to YUV using same equations as Intel IPP.
|
static void |
rgbToYuv(float r,
float g,
float b,
float[] yuv)
Conversion from RGB to YUV using same equations as Intel IPP.
|
static void |
ycbcrToRgb_U8(MultiSpectral<ImageUInt8> yuv,
MultiSpectral<ImageUInt8> rgb)
Conversion from YCbCr to RGB.
|
static void |
ycbcrToRgb(int y,
int cb,
int cr,
byte[] rgb)
Conversion from YCbCr to RGB.
|
static void |
yuvToRgb_F32(MultiSpectral<ImageFloat32> yuv,
MultiSpectral<ImageFloat32> rgb)
Convert a 3-channel
MultiSpectral image from YUV into RGB. |
static void |
yuvToRgb(double y,
double u,
double v,
double[] rgb)
Conversion from YUV to RGB using same equations as Intel IPP.
|
static void |
yuvToRgb(float y,
float u,
float v,
float[] rgb)
Conversion from YUV to RGB using same equations as Intel IPP.
|
public static void rgbToYuv(double r,
double g,
double b,
double[] yuv)
public static void rgbToYuv(float r,
float g,
float b,
float[] yuv)
public static void yuvToRgb(double y,
double u,
double v,
double[] rgb)
public static void yuvToRgb(float y,
float u,
float v,
float[] rgb)
public static void rgbToYCbCr(int r,
int g,
int b,
byte[] yuv)
r - Red [0 to 255]g - Green [0 to 255]b - Blue [0 to 255]public static void ycbcrToRgb(int y,
int cb,
int cr,
byte[] rgb)
y - Y [0 to 255]cb - Cb [0 to 255]cr - Cr [0 to 255]public static void yuvToRgb_F32(MultiSpectral<ImageFloat32> yuv, MultiSpectral<ImageFloat32> rgb)
MultiSpectral image from YUV into RGB.rgb - (Input) RGB encoded imageyuv - (Output) YUV encoded imagepublic static void rgbToYuv_F32(MultiSpectral<ImageFloat32> rgb, MultiSpectral<ImageFloat32> yuv)
MultiSpectral image from RGB into YUV.rgb - (Input) RGB encoded imageyuv - (Output) YUV encoded imagepublic static void ycbcrToRgb_U8(MultiSpectral<ImageUInt8> yuv, MultiSpectral<ImageUInt8> rgb)
yuv - YCbCr encoded 8-bit imagergb - RGB encoded 8-bit imageCopyright © 2013. All Rights Reserved.