ARToolKit for Mac OS X not compiled with BGRA support

Bug #1003655 reported by Ravi Sharma
6
This bug affects 1 person
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.setTexturesPower2(0)
#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("background-card")
cm.setFrame(-1, 1, 1, -1)
card = render2d.attachNewNode(cm.generate())
card.setTexture(tex)

#set the rendering order manually to render the card-with the webcam-image behind the scene.
base.cam.node().getDisplayRegion(0).setSort(20)

#load a model to visualize the tracking
axis = loader.loadModel("yup-axis")
axis.reparentTo(render)
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.make(base.cam, "./camera_para.dat", 1)

#attach the model to a pattern so it updates the model's position relative to the camera each time we call analyze()
ar.attachPattern("./patt.hiro", axis)

#updating the models positions each frame.
def updatePatterns(task):
  ar.analyze(tex, False)
  return Task.cont

sleep(1) #some webcams are quite slow to start up so we add some safety
taskMgr.add(updatePatterns, "update-patterns",-100)

run()

Revision history for this message
rdb (rdb) wrote :

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.

Changed in panda3d:
status: New → Invalid
Revision history for this message
Ravi Sharma (post-ravisharma) wrote :

Hi rdb ,

I am using official release version 1.8 for MAC OSX. And ARToolkit is a part of panda3d. I am not using any separate ARToolKit.

Please advise.

Regards
Ravi Sharma

Revision history for this message
rdb (rdb) wrote :

Ah, OK, sorry. That changes the matter.

Changed in panda3d:
assignee: nobody → rdb (rdb)
milestone: none → 1.8.1
status: Invalid → New
summary: - Panda3d 1.8 The copy of ARToolKit that you are using is not compiled
- for BGRA input. Panda3D cannot use this copy of ARToolKit. Modify the
- ARToolKit's config file and compile it again.
+ ARToolKit for Mac OS X not compiled with BGRA support
Revision history for this message
Neon22 (neon22) wrote :

You have the Frame wrong for Cardmaker.

should be:
card.setFrame(-1, 1, -1, 1)

Revision history for this message
rdb (rdb) wrote :

An alternative, maybe better way to fix this would be to add code to Panda to handle the case where ARToolKit expects ARGB images.

rdb (rdb)
Changed in panda3d:
status: New → In Progress
Revision history for this message
rdb (rdb) wrote :

OK, checked in a fix, will be in 1.8.1.

Changed in panda3d:
status: In Progress → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.