Vision Draw Polygon Vision Find Contours navigation bar

Table of Contents

Vision Draw Shape

Beta

This block is currently a beta version. If you are using this block, we would appreciate any feedback at tech@quanser.com.

Draws curve and shapes.

Library

QUARC Targets Beta/Image Processing/Open Source Computer Vision

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_beta/Image Processing/Open Source Computer Vision')

Description

Vision Draw Shape

The Vision Draw Shape block draws curve (line) and shapes (rectangle, circle, and ellipse) on the input image. The number of input ports varies depending on the type of shape to be drawn.

In order to use this block, be sure to follow the instructions described on the Vision Capture Image page, and take careful note of the limitations.

Input Ports

This block provides three input ports, namely, src_image, pt1, and pt2 for drawing a line or a rectangle. It provides three input ports, namely, src_image, center, and radius for drawing a circle. The number of input ports is six, namely, src_image, center, axes, angle, star_angle, and end_angle in case of an ellipse and it has four input ports, namely, src_image, center, angle, and size in case of an ellipse box.

src_image

A handle to a source image that uses OpenCV (Open Source Computer Vision) IplImage structure. The input may be a color or grayscale image.

pt1

Specifies (x, y) coordinate of the first point of a line segment or one of the rectangle vertices.

pt2

Specifies (x, y) coordinate of the second point of a line segment or the opposite rectangle vertex.

center

Specifies (x, y) coordinate of the center of a circle, ellipse, or an ellipse box.

radius

Specifies radius (in pixels) of a circle.

axes

Specifies axes lengths of an ellipse in (x, y) directions.

angle

Specifies the rotation angle of an ellipse (box).

start_angle

Specifies the starting angle of an elliptic arc.

end_angle

Specifies the ending angle of an elliptic arc.

size

Specifies width and height of an ellipse box.

Output Ports

dst_image

A handle to the destination image, which may be in 24-bit or 8-bit format depending on the input image. The output image shows the shape drawn at the specified location.

err

An error signal which is negative in case of invalid memory allocation or usage of invalid parameter values.

Parameters and Dialog Box

Vision Draw Shape

Draw

Specifies the type of shape to be drawn. The available options of shapes are Line, Rectangle, Circle, Ellipse, and Ellipse Box.

Color

Specify color components of the shape to be drawn.

Thickness

Specifies a thickness of the selected shape.

Line type

Specifies a type of shape boundary, which is 4-connected, 8-connected, or Antialiased. Antialiased shapes are drawn using Gaussian filtering.

Erase old trace

If this check box is selected, old traces are erased from the output image.

Updated image name

Specifies a name of the output image to be saved prior to model termination. The image is saved in JPEG file format. For example, the filename "/media/card/updatedimage" indicates that the image is saved under "/media/card/" folder with the filename updatedimage.jpg.

Sample time

The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time. A sample time of -1 indicates that the block inherits its sample time.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

No

No

Not supported.

QUARC Win64 Target

No

No

Not supported.

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

No

No

Not supported.

Rapid Simulation (RSIM) Target

No

No

Not supported.

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.

See Also

 

navigation bar