Draw a marker: problems with PTS parameter
11 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Anand
2013-11-18
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!
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!