[PD] opencv motion tracker external HELP!

IOhannes m zmoelnig zmoelnig at iem.at
Tue May 29 16:40:29 CEST 2007


nosehair911 at bellsouth.net wrote:
> Thanks for helping.  Well I basically have a rough sketch of all the objects but I am having a tough 
> time with the outlet system.  In a nutshell opencv uses an image structure called "typedef struct 
> _IplImage."  Acording to them "The structure IplImage came from Intel Image Processing Library 
> where the format is native."  I can give you more information about it if you need it.  My problem is 
> sending the result from IplImage to an outlet and being able to receive it from an inlet.  So far that is 
> my bigest hurdle.  I have this code:
> 
> IplImage *frame = 0;
> 
> x->x_outlet = outlet_new(&x->x_obj, &s_anything);
> outlet_anything(x->x_outlet, frame);
> 
> Obviously with more stuff in the middle but I keep getting this error from the compiler:


whoa don't do that.

if you are sure that you have to send pointers around, then you should
a) have a look at Gem (where this is done) or GridFlow and
b) don't do it (Gem is using this for legacy reasons); really. even
though pd has "pointers", they are not meant for passing arbitrary data
around.

if you want to do it the clean way, you will have to create ids (numeric
or symbolic), associate your data-chunks with ids, pass the ids through
pd's messaging system and look them up at the receiving side.
pdp does it like this.

an alternative might be mrpeach's "string/blob" patch, but then you
would rely on a patched pd, which is not a very good idea.

if you are not sure, then i suggest to not do it that way (unless you
want to spend some time in getting into coding)


otoh, why don't you just use the Gem framework?
i guess that you could fit the IplImage into an imageStruct with not
much overhead (but then i don't know this structure; if it is
fundamentally different from Gem's imageStruct you might lose everything
you gained speedwise)



if nothing else works, it might be simplest to just write your own
application (without pd) and send the data to pd via your favourite
protocol (FUDI, OSC, SMTP...)




More information about the Pd-list mailing list