Draw a marker: problems with PTS parameter

11 visualizaciones (últimos 30 días)
Marco
Marco el 15 de Nov. de 2013
Respondida: Anand el 18 de Nov. de 2013
Hi,
I've a matrix/image 256x256 of binaries and a set of points as matrix indices [m n]
[m n] =
45 98
23 118
45 185
I want to draw markers in these points. I tried with Computer Vision toolbox by:
markerInserter = vision.MarkerInserter
J = step(markerInserter,bw,[m n])
But it returns an error:
Error using MarkerInserter/step
The Pts input data type must be integer.
I don't understand it. Coordinates are integers.

Respuesta aceptada

Anand
Anand el 18 de Nov. de 2013
The coordinates may be integer valued, but are not stored in an integer datatype. You can see this if you do the following:
>> class(m)
I'd expect you to see double as the result. In order to use the MarkerInserter, points are expected to be of an integer datatype, namely one of the following: uint8, uint16, uint32, uint64, int8, int16, int32 or int64.
So, you can convert the matrix indices to an integer type:
J = step(markerInserter,bw,uint32([m n]));
Hope this helps!

Más respuestas (0)

Categorías

Más información sobre Computer Vision with Simulink en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by