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:
error: cannot convert IplImage* to t_symbol for argument 2 to "void outlet_anything(_outlet*, t_symbol*, int, t_atom*)
I still havent figured a way around this. I am sure its easy but... Anyway Im trying to figure out the outlet first before I tackle the inlet. Any advise? Alain
From: Tim Boykett tim@timesup.org Date: 2007/05/29 Tue AM 05:18:54 EDT To: nosehair911@bellsouth.net nosehair911@bellsouth.net Subject: Re: opencv motion tracker external HELP!
Hi Alain,
how is this coming along? I gather that you got the tracker working as a standalone, but no luck with the external yet. Is that right?
I would be interested in perhaps helping, but I thought I would check to see what was already working.
cheers,
tim
On 27/05/2007, at 10:35 PM, nosehair911@bellsouth.net
nosehair911@bellsouth.net wrote:For the last 2 weeks I have been trying to write a motion tracking
external using the blob motion tracker in opencv. I had success with writing a program that
recieves a path to an avi and motion tracks the blobs and prints their position. Now I am writing the
set of Pd externals using the same code with very little success. I need someone that knows what they
are doing to look at my Pd code and show me what I am doing wrong. I have read and followed
IOhannes guide on external writing. Also, I have looked at the zexy and pdp sorce code in order to
learn but still I am not getting it to work. The externals are based on the already working code I was able to
frankenstein together. I am calling it FTIR_Tools. It consist of the following (if I ever get
them to work!):
- FTIR_Cam: detects webcam and sends out frames to outlet.
- FTIR_VPlayer: reads quicktimes from path and sends out frames to
outlet. 3. FTIR_Tracker: tracks blobs, sends out "matrix blob# position" to
outlet2 and frames to outlet 1. you can also turn on and off visuals for center point and bounding
box. 4. FTIR_Window: displays frames in an X11 window.Please look at my code and show me how to fix it. I am getting
nowhere. In the cvBloblib.zip is the program I put together called Tracker and the code called
Tracker.cpp. If you want to see how it works drag it to terminal and follow it with a path to an .avi. You
must have opencv and fink installed. If you have ploblems installing opencv post and I will be glad to
help. Thanks, Alain <FTIR_Tools(src).zip> <cvBloblib.zip> _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
nosehair911@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...)