As data from on-board memory, processing, or the Bayer color
decoder
is transmitted to the Host, it passes through the color space converter and image formatter. The color space converter and image formatter can convert data in the following ways:
Subsampling.
Image data can be subsampled.
The color space converter and image formatter can subsample in the horizontal and vertical directions by integer factors of 1 to 16. The color space converter and image formatter uses nearest-neighbor interpolation.
You can use any of the following Aurora Imaging Library-Lite functions to subsample image data:
MdigControl() with M_GRAB_SCALE_X/Y and the subsampling factor.
MimResize() with ScaleFactorX and ScaleFactorY and the subsampling factor.
MbufTransfer() with M_COPY + M_SCALE and setting the destination buffer size smaller than the original image.
Zebra Rapixo CoF does not support cropping in hardware. However, you can have image data cropped during transfer to Host using MdigControl() with M_SOURCE_SIZE_X/Y and M_SOURCE_OFFSET_X/Y.
Flipping.
Images can be flipped horizontally or vertically, using the Aurora Imaging Library-Lite function MdigControl() with M_GRAB_DIRECTION_X/Y or when calling MimFlip() from on-board buffer to Host.
Color space conversion.
The color space converter and image formatter formats an image based on its type and the bit-depth and color format of the destination buffer. You can set the bit depth and color format of the destination buffer when you allocate it using the Aurora Imaging Library-Lite function MbufAlloc...(). The format of the source image is established in the DCF.
Image data can be converted as follows:
|
8-bit mono chrome output format
|
16-bit mono chrome output format
| | | | | | |
The equations for the YUV16 conversion are described in the following table. The value of depth is either 8 or 16 when converting BGR24 or BGR48 data, respectively.
While performing BGR48-to-YUV color space conversion, the operations are carried out on 16-bit data; then, each resulting YUV component is bit-shifted right by 8 bits (>> (depth - 8) where the value of depth is 16).
|
Y = (0.114B + 0.587G + 0.299R) >> (depth -8)
U = (0.500B - 0.331G - 0.169R + 2 ^ (depth-1)) >> (depth -8)
V = (0.081B - 0.419G - 0.500R + 2 ^ (depth-1)) >> (depth -8)
|