Clear Filters
Clear Filters

Draw a marker: problems with PTS parameter

3 views (last 30 days)
Marco
Marco on 15 Nov 2013
Answered: Anand on 18 Nov 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.

Accepted Answer

Anand
Anand on 18 Nov 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!

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!