Hello Everyone,
Thank you, I really appreciate your support! The bindings are coming
out fine. I managed to expose the basic functionality of OpenNI,
namely the image and depth streams to Python. Now that the core of the
wrapper is down, it should be much easier to expose more
functionality.
A few years ago, I would have used SWIG to do something like this, but
in my experience automatically generated bindings tend to be somewhat
unreliable, and my immediate need is just to tap into a smaller subset
of OpenNI's functionality. So, I used Boost Python instead to get me
more fine grained control.
I am planning to put out an initial preliminary release of the code
within the next couple of days on Google Code. I would like to make
the code most useful to everyone for both commercial and non-
commercial use. Any advice on which standard open source licence I
should go for and still be compatible with the core of OpenNI/NITE?
While the binding is still at a preliminary stage, the code is
relatively clean, and the basic structure should be straightforward
enough for other people to contribute, so I am quite excited to share
my work with you!
I tried to make the API pretty faithful to OpenNI/NITE. Here is sample
on how to use it for your consideration:
def unitTestImageGenerator():
global g_context
g_context = ONIPY.OpenNIContext()
g_context.InitFromXmlFile( OPENNI_INITIALIZATION_FILE )
imageGenerator = ONIPY.OpenNIImageGenerator()
returnCode = g_context.FindExistingNode( \
ONIPY.XN_NODE_TYPE_IMAGE, \
imageGenerator )
returnCode = g_context.WaitAndUpdateAll()
if returnCode == ONIPY.XN_STATUS_OK:
print "update was successful"
else:
print "update was not successful"
if imageGenerator.IsValid():
# NOTE: the meta data is exposed directly through the generator
print "X resolution: ", imageGenerator.XRes()
print "Y resolution: ", imageGenerator.YRes()
g_context.Shutdown()
-gamix
On Jan 17, 4:10 pm, MattY <
mattyye...@gmail.com> wrote:
> Hi Gamix,
>
> How are yourPythonbindings going for OpenNI/NITE?