Vision Find Contours Vision Get Iplimage Data navigation bar

Table of Contents

Vision Get Centroid Pose

Beta

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

Calculates centroid of the specified binary blob(s).

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 Get Centroid Pose

The Vision Get Centroid Pose block takes a binary image as the input and calculates the centroid of the binary blob(s) according to the specified method. The outputs of this block include (x, y) coordinate of the centroid and its angular oriention with respect to the center of the input image.

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

image

A handle to a 8-bit binary image that uses OpenCV (Open Source Computer Vision) IplImage structure.

Output Ports

centroid_xy

(x, y) coordinate of the centroid.

centroid_ang

Horizontal and vertical angular deviations of the centroid with respect to the center of the image. Each pixel is mapped horizontally and vertically to an angular resolution with respect to the specified view angle of the camera. Then, horizontal and vertical angular deviations are calculated as: angular resolution x centroid coordinate.

err

This signal is negative in case of error.

Parameters and Dialog Box

Vision Get Centroid Pose

Field of view of the camera

Specifies the field of view of the camera in degrees. The parameter value must be 0 to 360 degrees.

Centroid type

Specifies the method of centroid calculation. The options are: Weighted average of centroids using blob area, Centroid of the largest blob, and Centroid of the closest path block. The first option considers binary blobs having areas greater than the minimum threshold area and calculated the weighted average of centroids. The second option calculates the centroid of the largest blob. The third option is suitable for path tracking, which gives the centroid of the binary blob closest to the center-bottom point of the image.

Minimum threshold area

Specifies the minimum threshold area in pixels. The binary blobs having areas less than the threshold value are discarded for centroid calculation. The parameter value must be less than 25 for "Centroid of the closest path block" option.

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.

 

navigation bar