Image Find Tags Image Optical Flow navigation bar

Table of Contents

Image Logic

Applies the selected bitwise logic operation to a pair of images or a single image.

Library

QUARC Targets/Image Processing/Generic

Description

Image Logic

The Image Logic block applies the selected bitwise logic operation to images. The standard boolean operations are supported: AND, OR, XOR and NOT. The number of inputs to the block changes according to the operation selected.

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

This block is similar to the Simulink Bitwise Operator block. However, it supports the single and double data types, which the Simulink block does not. Also, the Image Logic block can perform bitwise operations on images of different sizes.

The dimensions of the output image are always equal to the dimensions of the first input. The second input, when present, may be a different size than the first input but must be the same data type. If the first input is an RGB image (MxNx3) then the second input may be RGB (MxNx3) or grayscale (MxN). However, if the first input is a grayscale image then the second input must also be a grayscale image. The general perspective is that the second input is operating on the first input to produce the output.

Input Ports

image1

The input may be an RGB image specified as a three-dimensional MxNx3 matrix where M is the image height and N is the image width. It contains the red, green and blue components for each pixel in the image.

It may also be a grayscale image specified as a two-dimensional MxN matrix. where M is the image height and N is the image width. It contains the luminance for each pixel in the image.

The interpretation of the data depends on the data type. Floating-point types should 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 should be the full range for the integer type.

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

image2

This input must have the same data type as the image1 input, but may have different dimensions. If the image1 input is RGB, then the image2 input may be RGB or grayscale. If the image1 input is grayscale, then the image2 input must also be grayscale since the output will be grayscale to match image1.

Output Ports

image

The output data type and dimensions must match the image1 input signal.

Parameters and Dialog Box

Image Logic

Algorithm

The logical operation to use. The algorithm will determine the number of inputs. The block will have two inputs when a binary operation is selected and a single input otherwise.

Source of offset

For binary operations, the second input may be offset when applied to the first input. The offset allows small mask bitmaps, for instance, to be used to mask or paint small areas within a larger image. The Source of offset parameter selects whether the (row, column) offset is specified as a dialog parameter or via inputs to the block.

Row offset (tunable online)

The row offset to apply to the second input when performing a binary operation. The row offset may be positive or negative and its magnitude may exceed the height of the first image (in which case no operation is performed).

Column offset (tunable online)

The column offset to apply to the second input when performing a binary operation. The column offset may be positive or negative and its magnitude may exceed the width of the first image (in which case no operation is performed).

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