필터 지우기
필터 지우기

Draw a marker: problems with PTS parameter

조회 수: 3 (최근 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 CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by