Documentation of 'boofcv.alg.color.ColorYuv' Java class
ColorYuv
boofcv.alg.color

Class ColorYuv



  • public class ColorYuv
    extends java.lang.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:

    • http://en.wikipedia.org/wiki/YUV
    • http://software.intel.com/sites/products/documentation/hpc/ipp/ippi/ippi_ch6/ch6_color_models.html
    • Keith Jack, "Video Demystified" 5th ed 2007

    • Constructor Summary

      Constructors 
      Constructor and Description
      ColorYuv() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      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(Planar<GrayF32> rgb, Planar<GrayF32> yuv)
      Convert a 3-channel Planar 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(Planar<GrayU8> yuv, Planar<GrayU8> 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(Planar<GrayF32> yuv, Planar<GrayF32> rgb)
      Convert a 3-channel Planar 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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ColorYuv

        public ColorYuv()
    • Method Detail

      • rgbToYuv

        public static void rgbToYuv(double r,
                                    double g,
                                    double b,
                                    double[] yuv)
        Conversion from RGB to YUV using same equations as Intel IPP.
      • rgbToYuv

        public static void rgbToYuv(float r,
                                    float g,
                                    float b,
                                    float[] yuv)
        Conversion from RGB to YUV using same equations as Intel IPP.
      • yuvToRgb

        public static void yuvToRgb(double y,
                                    double u,
                                    double v,
                                    double[] rgb)
        Conversion from YUV to RGB using same equations as Intel IPP.
      • yuvToRgb

        public static void yuvToRgb(float y,
                                    float u,
                                    float v,
                                    float[] rgb)
        Conversion from YUV to RGB using same equations as Intel IPP.
      • rgbToYCbCr

        public static void rgbToYCbCr(int r,
                                      int g,
                                      int b,
                                      byte[] yuv)
        Conversion from RGB to YCbCr. See [Jack07].
        Parameters:
        r - Red [0 to 255]
        g - Green [0 to 255]
        b - Blue [0 to 255]
      • ycbcrToRgb

        public static void ycbcrToRgb(int y,
                                      int cb,
                                      int cr,
                                      byte[] rgb)
        Conversion from YCbCr to RGB. See [Jack07].
        Parameters:
        y - Y [0 to 255]
        cb - Cb [0 to 255]
        cr - Cr [0 to 255]
      • yuvToRgb_F32

        public static void yuvToRgb_F32(Planar<GrayF32> yuv,
                                        Planar<GrayF32> rgb)
        Convert a 3-channel Planar image from YUV into RGB.
        Parameters:
        rgb - (Input) RGB encoded image
        yuv - (Output) YUV encoded image
      • rgbToYuv_F32

        public static void rgbToYuv_F32(Planar<GrayF32> rgb,
                                        Planar<GrayF32> yuv)
        Convert a 3-channel Planar image from RGB into YUV. NOTE: Input and output image can be the same instance.
        Parameters:
        rgb - (Input) RGB encoded image
        yuv - (Output) YUV encoded image
      • ycbcrToRgb_U8

        public static void ycbcrToRgb_U8(Planar<GrayU8> yuv,
                                         Planar<GrayU8> rgb)
        Conversion from YCbCr to RGB. NOTE: Input and output image can be the same instance.
        Parameters:
        yuv - YCbCr encoded 8-bit image
        rgb - RGB encoded 8-bit image

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.