ToOpenCV

Converts Simulink data types to Opaque (OpenCV) data types

  • Library:
  • Computer Vision Toolbox OpenCV Interface for Simulink

Description

The ToOpenCV block is used to convert the Simulink data types to Simulink Opaque (OpenCV) data types.

Ports

Inputs

expand all

Input signal to the ToOpenCV block. The input can be of different data types. Each of the input data types determines the output data type of the block.

Data Types: uint8 array | uint16 array | int8 array | int16 array | int32 array | single array | double array | CV_DMATCH_BUS | CV_DMATCH_BUS (1d array) | CV_DMATCH_BUS (2d array) | CV_RECT_BUS | CV_RECT_BUS (1d array) | CV_ROTATEDRECT_BUS | CV_ROTATEDRECT_BUS (1d array) | CV_TERMCRITERIA_BUS | CV_SIZE_BUS | CV_RANGE_BUS | CV_POINT2I_BUS | CV_POINT2F_BUS | CV_POINT2D_BUS | CV_POINT3I_BUS | CV_POINT3F_BUS | CV_POINT3D_BUS | CV_POINT2I_BUS (1d array) | CV_POINT2F_BUS (1d array) | CV_POINT2D_BUS (1d array) | CV_POINT3I_BUS (1d array) | CV_POINT3F_BUS (1d array) | CV_POINT3D_BUS (1d array) | CV_POINT2I_BUS (2d array) | CV_POINT2F_BUS (2d array) | CV_POINT2D_BUS (2d array) | CV_POINT3I_BUS (2d array) | CV_POINT3F_BUS (2d array) | CV_POINT3D_BUS (2d array)

Output

expand all

Output signal from the ToOpenCV block.

Data Types: cv_Mat | cv_DMatch | vector_cv_DMatch | vector_vector_cv_DMatch | cv_Rect | vector_cv_Rect | cv_RotatedRect | vector_cv_RotatedRect | cv_TermCriteria | cv_Scalar | cv_Size | cv_Range | cv_Point | cv_Point2f | cv_Point2d | cv_Point3i | cv_Point3f | cv_Point3d | vector_cv_Point | vector_cv_Point2f | vector_cv_Point2d | vector_cv_Point3i | vector_cv_Point3f | vector_cv_Point3d | vector_vector_cv_Point | vector_vector_cv_Point2f | vector_vector_cv_Point2d | vector_vector_cv_Point3i | vector_vector_cv_Point3f | vector_vector_cv_Point3d

Parameters

expand all

Use this parameter to specify the input data type of the ToOpenCV block. The table lists the one-to-one mapping of the input versus output data types of the ToOpenCV block.

OpenCV Data Type Simulink Opaque Data Type (Output Signal Data Type)Simulink Data Type (Input Signal Data Type)
Mat or Mat-Imagecv_Matuint8 array
uint16 array
int8 array
int16 array
int32 array
single array
double array
DMatchcv_DMatchCV_DMATCH_BUS
vector<DMatch>vector_cv_DMatchCV_DMATCH_BUS (1d array)
vector<vector<DMatch>>vector_vector_cv_DMatchCV_DMATCH_BUS (2d array)
Rectcv_RectCV_RECT_BUS
vector<Rect>vector_cv_RectCV_RECT_BUS (1d array)
RotatedRectcv_RotatedRectCV_ROTATEDRECT_BUS
vector<RotatedRect>vector_cv_RotatedRectCV_ROTATEDRECT_BUS (1d array)
TermCriteriacv_TermCriteriaCV_TERMCRITERIA_BUS
Scalarcv_Scalardouble array
Sizecv_SizeCV_SIZE_BUS
Rangecv_RangeCV_RANGE_BUS
Pointcv_PointCV_POINT2I_BUS
Point2fcv_Point2fCV_POINT2F_BUS
Point2dcv_Point2dCV_POINT2D_BUS
Point3icv_Point3iCV_POINT3I_BUS
Point3fcv_Point3fCV_POINT3F_BUS
Point3dcv_Point3dCV_POINT3D_BUS
vector<Point>vector_cv_PointCV_POINT2I_BUS (1d array)
vector<Point2f>vector_cv_Point2fCV_POINT2F_BUS (1d array)
vector<Point2d>vector_cv_Point2dCV_POINT2D_BUS (1d array)
vector<Point3i>vector_cv_Point3iCV_POINT3I_BUS (1d array)
vector<Point3f>vector_cv_Point3fCV_POINT3F_BUS (1d array)
vector<Point3d>vector_cv_Point3dCV_POINT3D_BUS (1d array)
vector<vector<Point>>vector_vector_cv_PointCV_POINT2I_BUS (2d array)
vector<vector<Point2f>>vector_vector_cv_Point2fCV_POINT2F_BUS (2d array)
vector<vector<Point2d>>vector_vector_cv_Point2dCV_POINT2D_BUS (2d array)
vector<vector<Point3i>>vector_vector_cv_Point3iCV_POINT3I_BUS (2d array)
vector<vector<Point3f>>vector_vector_cv_Point3fCV_POINT3F_BUS (2d array)
vector<vector<Point3d>>vector_vector_cv_Point3dCV_POINT3D_BUS (2d array)

Programmatic Use

Block Parameter: DataType
Type: character vector
Value: input data type
Default: 'Point2i'

Block Characteristics

Data Types

Direct Feedthrough

Yes

Multidimensional Signals

Yes

Variable-Size Signals

No

Extended Capabilities

Introduced in R2020a