3

How can I retrieve the coordinates of a marker in ARToolKit and save like a 2D coordinates. So I can try to cut a jpg file using those coordinates.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Ruben Veiga
  • 343
  • 3
  • 15
  • So, you're asking for the 2D image coordinates, or the 3D "world" coordinates? – Bart Mar 22 '12 at 06:41
  • more or less i kon the marker in the artoolkit have 3d coordinates because its use the deep closer to the video cam larger box far away smaller box, But i know need the to see if its closer or far away just the position on screen. i dont know if you can understand me english not my native language – Ruben Veiga Mar 22 '12 at 11:00

1 Answers1

3

The 2D positions of both the corners and center of a marker are easily retrievable. They are stored in the ARMarkerInfo structure. The corners are ARMarkerInfo.vertex[][] and the center is ARMarkerInfo.pos[].

The easiest place to retrieve this is in the main detection loop, e.g. mainLoop in the simple or simpleLite examples.

bleater
  • 5,098
  • 50
  • 48
  • thanks bleater, i will see this and later tell you something ;) – Ruben Veiga Mar 30 '12 at 00:43
  • thanks @bleater but how can i use the ARMarkerInfo.vertex[][] coordinates so i can draw a polygon using the same position i get from there? – Ruben Veiga May 03 '12 at 16:37
  • 2
    Have a look in ARToolKit at util/mk_patt source, since mk_patt does exactly that, drawing a polygon around detected trapezoidal regions. – bleater May 28 '12 at 09:20