Table of Contents
Image Logic
Applies the selected bitwise logic operation to a pair of images or a single image.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Image Processing/Generic')Description
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'
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
doc vision;This block is similar to the Simulink
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
doc('bitwise operator');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'
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
doc vision;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
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 |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
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 |
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.