This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


System object: vision.MarkerInserter
Package: vision

Draw specified marker on input image


J = step(markerInserter,I,PTS)
J = step(markerInserter,I,PTS,ROI)
J = step(markerInserter,I,PTS,...,CLR)


    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

J = step(markerInserter,I,PTS) draws the marker specified by the Shape property on input image I. The input PTS specify the coordinates for the location of the marker. You can specify the PTS input as an M-by-2 [x y] matrix of M number of markers. Each [x y] pair defines the center location of the marker. The markers are embedded on the output image J.

J = step(markerInserter,I,PTS,ROI) draws the specified marker in a rectangular area defined by the ROI input. This applies when you set the ROIInputPort property to true. The ROI input defines a rectangular area as [x y width height], where [x y] determine the upper-left corner location of the rectangle, and width and height specify the size.

J = step(markerInserter,I,PTS,...,CLR) draws the marker with the border or fill color specified by the CLR input. This applies when you set the BorderColorSource property or the FillColorSource property to 'Input port'.

    Note:   H specifies the System object on which to run this step method.

    The object performs an initialization the first time the step method is executed. This initialization locks nontunable properties (MATLAB) and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object issues an error. To change nontunable properties or inputs, you must first call the release method to unlock the object.

Input Arguments


Shape inserter object with shape and properties specified.


Input image.


Input M-by-2 matrix of M number of [x y] coordinates describing the location for markers. This property must be an integer value. If you enter non-integer value, the object rounds it to the nearest integer.


Each [x y] pair defines the center of a marker.

The table below shows the data types required for the inputs, I and PTS.

Input image IInput matrix PTS
built-in integerbuilt-in or fixed-point integer
fixed-point integerbuilt-in or fixed-point integer
doubledouble, single, or build-in integer
singledouble, single, or build-in integer


Scalar, vector, or matrix describing one plane of the RGB input video stream.


Input 4-element vector of integers [x y width height], that define a rectangular area in which to draw the shapes. The first two elements represent the one-based coordinates of the upper-left corner of the area. The second two elements represent the width and height of the area.

  • Double-precision floating point

  • Single-precision floating point

  • 8-, 16-, and 32-bit signed integer

  • 8-, 16-, and 32-bit unsigned integer


This port can be used to dynamically specify shape color.

P-element vector or an M-by-P matrix, where M is the number of shapes, and P, the number of color planes. You can specify a color (RGB), for each shape, or specify one color for all shapes. The data type for the CLR input must be the same as the input image.

Output Arguments


Output image. The markers are embedded on the output image.

Was this topic helpful?