Draw a marker: problems with PTS parameter

12 ビュー (過去 30 日間)
Marco
Marco 2013 年 11 月 15 日
回答済み: Anand 2013 年 11 月 18 日
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.

採用された回答

Anand
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 件)

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by