PyARTK
Content
About this package
This package contains the interface for building ARToolKit binding for python with Distutils. It has been tested with ARToolKit 2.72 on Linux and MacOSX The latest version of ARToolKit is available from http://sf.net/projects/artoolkit.
Dependencies
- Python.
- ARToolKit library.
- SWIG for generating C wrapper code (SWIG version 1.3.20 or higher is required).
- Numeric. We are still using the old version of Numeric, we will move toward using Numpy in the near future.
- memoryobject package distributed with PyARTK
Build and Installation instructions
PyARTK is currently supported on Linux and MacOSX platforms. Make sure you have install the dependencies. Ensure ARToolKit is installed and running correctly. The following will explain how to build and install the PyARTK and Memoryobject packages. The following installation instructions can be used on both Linux and MacOSX.
- Unpack PyARTK into a local folder. (e.g /home/name/projects)
$> tar -xfz PyARTK-x.x.tar.gz
- cd to the project file you just unpack
$> cd /home/name/projects/PyARTK-x.x
- You need to know where artoolkit is installed and edit the setup.py file. Edit the path to your ARToolKit installation include and libraries files
- Build the extensions and install the package: (make sure you have the swig executable in your path )
$> python setup.py install
The package will be installed in the site-packages directory of your python installation for example: sys.exec_prefix/lib/python2.4/site_packages/
- Unpack memoryobject into a local folder. (e.g /home/name/projects)
$> tar -xfz memoryobject-x.x.tar.gz
- cd to the project file you just unpack
$> cd /home/name/projects/memoryobject-x.x
- Build the extensions and install the package: (make sure you have the swig executable in your path )
$> python setup.py install
- To build the package and install in a user specified directory:
$>python setup.py install --install-platlib=YOUR_DIR
where YOUR_DIR is the path to the install directory.
Example:- on Windows:
$>python setup.py install --install-platlib="C:\\MyFolder"
- on Unix:
$>python setup.py install --install-platlib=/home/me/Myfolder
- on Windows:
- See "python setup.py install --help" for more options.
Testing
There are 2 examples in PyARTK/Tests. You need to have PyARTK in your pythonpath.
- simple test (rewrite of simple test from ARToolKit
start python and type the following
>>> from PyARTK.Tests.test_PyARTK import test_TrackerMarker >>> a = test_TrackerMarker()
- test video ( you must have a video device connected to your computer)
This test will just show the video image capture by the video device.
You need to have Tkinter and PIL ( Image Library package )
>>> from PyARTK.Tests.test_arvideo import video_tk >>> video_tk()
Known Issues
The python binding does not wrap the functions defined in gsub.h gsub_lite.h, and we are not planning to include them in the package. You will need to use another means to create your OpenGL display, you could use PyOpenGL.