Inquiry on "arGetTransMatCont"

Discussion relating to the open-source GPL-licensed ARToolKit v2.x.

Moderator: ARToolKit developers

Inquiry on "arGetTransMatCont"

Postby Brian Leung » Fri May 25, 2012 7:50 pm

Hi all,

I am using the "arGetTransMatCont" routine to get the marker 3d matrices for an application with 5 different markers placed on 5 faces of a cube.
My code of the mainloop() is basically as follows:

....

for(int i = 0; i < objectnum; i++ )
{
for(int j = 0; j < marker_num; j++ )
{
if( object[i].id == marker_info[j].id) //may detect some markers with the same id, need to look for the best match then
{
if( k == -1 )
{
k = j;
}
else // make sure you have the best pattern (highest confidence factor)
{
if( marker_info[k].cf < marker_info[j].cf )
k = j;
}
}
}//end of for j


if( k == -1 )
continue;

arGetTransMatCont(&marker_info[k],object[i].trans,
object[i].marker_center, object[i].marker_width,
object[i].trans);

}//end of for i
....

Render 3D object with the object with the highest cf



the "arGetTransMatCont" routine gives wrong matrices occasionally,

for example:

using arGetTransMat for the same frame for the same input image sequences,marker chosen is top of cube

0.26504 0.74843 -0.60795 -262.01869
0.71899 0.26672 0.64181 70.11113
0.6425 -0.60721 -0.46742 1556.6013


using arGetTransMatCont for the same frame for the same input image sequences,
marker chosen is the face turned 90degrees along the z-axis from the top of the cube

-0.26409 -0.74986 -0.6066 263.94978
-0.71853 -0.2666 0.64238 -70.62908
-0.64341 0.60551 -0.46839 -1568.12237

Wonder if I did something wrong in my code that gives this weird result, the z value of the translation is obviously wrong but it's like mirrored
from the correct one.

Regards,

Brian
Brian Leung
 
Posts: 3
Joined: Thu May 17, 2012 9:41 am

Return to ARToolKit (v2.x)

Who is online

Users browsing this forum: No registered users and 2 guests

cron