Image Compress Image Decompress navigation bar

Table of Contents

Image Convert

Converts from one image format to another.

Library

QUARC Targets/Image Processing/Generic

Description

Image Convert

The Image Convert block converts from one image format to another. For example, it can convert from interleaved RGB888 (3XWxH) format to planar, MATLAB RGB (HxWx3) format.

The Image Convert block supports both MATLAB RGB (HxWx3) and MATLAB grayscale (HxW) outputs. A variety of different output data types are supported that are compatible with The MathWorks' Computer Vision System Toolbox, including both integer and floating-point data types.

It also supports some other output image formats that are not compatible with the Computer Vision System Toolbox but may be useful for interfacing to custom S-functions or other systems.

The currently supported input formats are tabulated below:

Input Format

Description

MATLAB grayscale (HxW)

A grayscale HxW column-major image i.e., the first column of pixels is stored first, followed by the next column of pixels, etc. All the image data types used by the Computer Vision Toolbox are supported: uint8, uint16, uint32, single and double.

MATLAB RGB (HxWx3)

A color HxWx3 column-major image containing planar RGB values i.e., the red plane is stored first, the green next and the blue last. Each plane is stored with the first column of pixels first, followed by the next column of pixels, etc. All the image data types used by the Computer Vision Toolbox are supported: uint8, uint16, uint32, single and double.

RGB888 (3xWxH)

A color 3xWxH row-major image containing packed RGB values i.e., the first element in memory is the red pixel value, followed by the green pixel value, followed by the blue pixel value. The first row of pixels is stored first, followed by the next row, etc. Only the uint8 data type is currently supported for this input.

BGR888 (3xWxH)

A color 3xWxH row-major image containing packed BGR values i.e., the first element in memory is the blue pixel value, followed by the green pixel value, followed by the red pixel value. The first row of pixels is stored first, followed by the next row, etc. Only the uint8 data type is currently supported for this input.

This image format matches the standard CV_8UC3 format used by OpenCV.

Y (luminescence only, WxH)

A grayscale WxH row-major image containing the luminescence values. The first row of pixels is stored first, followed by the next row, etc. Both uint8 and uint16 data types are supported for this input. The uint16 data type is typical of depth images.

A subset of the input image formats are supported as output image formats. Not all conversions are possible and not all combinations of input and output data types are supported. The block will report if a particular combination is not supported.

Input Ports

image

This input is an image whose number of dimensions and supported data types depend on the Input format parameter.

u

This input is the U chroma component whose number of dimensions and supported data types depend on the Input format parameter. This input is only present for certain input formats.

v

This input is the V chroma component whose number of dimensions and supported data types depend on the Input format parameter. This input is only present for certain input formats.

Output Ports

image

The output data type and dimensions depend on the Output format selected. The output may be an RGB or grayscale image.

The interpretation of the data depends on the data type. Floating-point types have elements in the range 0 to 1. Both single and double floating-point types are supported. For integer types, only unsigned integer types are supported. The range of unsigned integer types is the full range for the integer type.

The output is compatible with The MathWorks' Computer Vision System Toolbox.

Parameters and Dialog Box

Image Convert

Input format

The format of the input image.

Padding

The number of bytes of padding at the end of each row in the input image. The width in bytes of the image plus the padding is equal to the stride. The padding is set to zero by default. This parameter is disabled for the MATLAB image formats because their padding is always zero.

Output format

The format of the output image.

Output data type

The data type of the output image.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

Yes

Yes

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

* Compatible means that the block can be compiled for the target.

 

navigation bar