Class ConvertYuyv

java.lang.Object
boofcv.core.encoding.ConvertYuyv

public class ConvertYuyv extends Object

Packed format with ½ horizontal chroma resolution, also known as YUV 4:2:2

In this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_YUYV is known in the Windows environment as YUY2.

Description taken from V4L documentation.

  • Constructor Details

    • ConvertYuyv

      public ConvertYuyv()
  • Method Details

    • yuyvToBoof

      public static void yuyvToBoof(byte[] data, int width, int height, ImageBase output)
      Converts a YU12 encoded byte array into a BoofCV formatted image.
      Parameters:
      data - (input) YU12 byte array
      width - (input) image width
      height - (input) image height
      output - (output) BoofCV image
    • yuyvToGray

      public static GrayU8 yuyvToGray(byte[] data, int width, int height, GrayU8 output)
      Converts an Yuyv image into a gray scale U8 image.
      Parameters:
      data - Input: Yuyv image data
      width - Input: image width
      height - Input: image height
      output - Output: Optional storage for output image. Can be null.
      Returns:
      Gray scale image
    • yuyvToGray

      public static GrayF32 yuyvToGray(byte[] data, int width, int height, GrayF32 output)
      Converts an Yuyv image into a gray scale F32 image.
      Parameters:
      data - Input: Yuyv image data
      width - Input: image width
      height - Input: image height
      output - Output: Optional storage for output image. Can be null.
      Returns:
      Gray scale image