ARToolKit for Mac OS X not compiled with BGRA support
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Panda3D |
Fix Released
|
Undecided
|
rdb |
Bug Description
I am running Panda3d 1.8 Official build on MAC OX ( 32 bit ) and want to try ARToolkit sample.
It is giving : vision : The copy of ARToolKit that you are using is not compiled for RGB, BGR, RGBA or BGRA input. Panda3D cannot use this copy of ARToolKit. Please modify the ARToolKit's config file and compile it again.
Please let me know how to resolve this issue
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.
from direct.directbase import DirectStart
from direct.task import Task
from time import sleep
#------use OpenCVTexture under linux---------- use WebcamVideo under windows------------
tex = OpenCVTexture()
#------
tex.setTextures
#if you want to know what assert is doing.. ask pro-rsoft. all i know is, it prevents an assertion error :D
assert tex.fromCamera(0)
#create a card which shows the image captured by the webcam.
cm = CardMaker(
cm.setFrame(-1, 1, 1, -1)
card = render2d.
card.setTexture
#set the rendering order manually to render the card-with the webcam-image behind the scene.
base.cam.
#load a model to visualize the tracking
axis = loader.
axis.reparentTo
axis.setScale(.2)
#initialize artoolkit, base.cam 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.
ar = ARToolKit.
#attach the model to a pattern so it updates the model's position relative to the camera each time we call analyze()
ar.attachPatter
#updating the models positions each frame.
def updatePatterns(
ar.analyze(tex, False)
return Task.cont
sleep(1) #some webcams are quite slow to start up so we add some safety
taskMgr.
run()
Changed in panda3d: | |
status: | New → In Progress |
Changed in panda3d: | |
status: | Fix Committed → Fix Released |
The problem is that your copy of ARToolKit is not compiled for RGB, BGR, RGBA or BGR input.
To resolve this issue, modify ARToolKit's config file and compile it again.