ARToolkit small error - Video samples (youtube).

Hi! I have a small displacement error on the marker position.

I’ve found out that the displacemente changes according to the size of the VideoTexture being analyzed.

Here are some youtube videos where you can see clearly the problem.

And the code:

# -*- coding: utf-8 -*-
from pandac.PandaModules import *
loadPrcFileData("", "auto-flip 1") #usualy the drawn texture lags a bit behind the calculted positions. this is a try to reduce the lag.
#loadPrcFileData("", "fullscreen 1")
from direct.directbase.DirectStart import * 
from direct.showbase.DirectObject import DirectObject 
from direct.gui.OnscreenText import OnscreenText
from direct.task import Task
from time import sleep

def textoDebug(pos, msg):
    return OnscreenText(text=msg, style=1, fg=(1,1,1,1),
      pos=(-1.3, pos), align=TextNode.ALeft, scale = .05)

class FundacionMasAR(DirectObject): 
    def update(self,task): 
        if self.cursor.ready(): 
            self.cursor.fetchIntoTexture(0, self.videoTexture, 0) 
        self.posMark1.setText(("Mark1: x=%.2f" % self.axis.getX()) + (", y=%.2f" % self.axis.getY()) + (", z=%.2f" % self.axis.getZ()))
        return task.cont 
    def __init__(self):

        self.posMark1 = OnscreenText()
        self.posPanda = OnscreenText()

        print str(PandaSystem.getVersionString()) 
        #set the rendering order manually to render the card-with the webcam-image behind the scene.
        base.camLens.setAspectRatio(640.0 / 480.0)
        # ----------- Inicializar camara ------------
        #print "Seleccione una camara" 
        #for o in range(WebcamVideo.getNumOptions()): 
        #option = WebcamVideo.getOption(o) 
        #print "Opcion %d, '%s' x %f fps" % (o, option.getName(), option.getFps()) 
        #op = int(raw_input("option>")) 
        #option = WebcamVideo.getOption(op) 
        # Establecerla directamente
        option = WebcamVideo.getOption(0) 
        self.cursor = 
        self.videoTexture = Texture('movie') 
        # ------------------------------------------------
        # What about this? Didn't do the trick.
        self.videoTextureScale = Vec2(option.getSizeX()/float(self.videoTexture.getXSize()), option.getSizeY()/float(self.videoTexture.getYSize())) 
        self.txtCursor = textoDebug(0.95,"Cursor: " + str(self.cursor.sizeX()) + " x " + str(self.cursor.sizeY()))
        self.txtVideoTex = textoDebug(0.90,"VideoTexture: " + str(self.videoTexture.getXSize()) + " x " + str(self.videoTexture.getYSize()))
        # This didn't work either.        
        # ---- CardMaker ---------------------------------
        = CardMaker("background-card"), -1, -1, 1)
        # set the uv coordinates of the card, y-scale must be reversed[0],0), Point2(0,self.videoTextureScale[1]))
        #cm.setUvRange(Point2(1,0), Point2(0,1))
        self.card = render2d.attachNewNode(
        # ---- ARToolkit ---------------------------------
        #initialize artoolkit, is our camera ,
        #the camera_para.dat is the configuration file for your camera. this one comes with the artoolkit installation.
        #last paremeter is the size of the pattern in panda-units. = ARToolKit.make(, "./camera_para.dat", 1)
        #load a model to visualize the tracking
        self.axis = loader.loadModel("yup-axis")
        self.posMark1 = textoDebug(0.85,"Mark1: x=" + str(self.axis.getX()) + ", y=" + str(self.axis.getY()) + " z=" + str(self.axis.getZ()))
        #attach the model to a pattern so it updates the model's position relative to the camera each time we call analyze()"./raro1.pat", self.axis)
        sleep(1) #some webcams are quite slow to start up so we add some safety
        taskMgr.add(self.update, "update-patterns",-100)