Hi list,
I am trying to resize a live video feed to a very small picture (16x12), extract a list of rgba values from this image and pass the list to ann_mlp.
On my system the pix_resize object keeps eating RAM over and over every time I pass it a pix. (see the attached patch)
Maybe either the unsigned char * resizedData or the old image.data should be freed somewhere?
WinXP GEM 0.90 (compiled Aug 3 2004) Pd 0.38-3
Btw: in a old post (http://lists.puredata.info/pipermail/pd-list/2005-04/027626.html) I've read that pix_resize can be used with 2 args: [pix_resize X Y] to get an image Y height and X width But in the example patch attached it doesn't seem to work, and looking at the source code (pix_resize.cpp) I don't see how pix_resize could do that. ... Is there a way to reduce an image size? E.g. from 320x240 to 16x12 pixels?
Thank you, Davide.
Hallo!
I am trying to resize a live video feed to a very small picture (16x12), extract a list of rgba values from this image and pass the list to ann_mlp.
just an idea: If you want to process the pixel data in a neural net I think it would be much faster if you write a GEM-external and process the data in C++ with fann (I did something similar a while ago ...), because maybe you'll need a lot of CPU :)
LG Georg
Hi, As Georg suggested I am writing a gem external to use multilayer perceptrons with images. I am having some problem linking due to my lack of experience with cpp:
.... ann_pix_mlp error LNK2019: unresolved external symbol "__declspec(dllimport) const ann_pix_mlp::`vftable'" (__imp_??_7ann_pix_mlp@@6B@) referenced in function "public: __thiscall ann_pix_mlp::ann_pix_mlp(float,float)" (??0ann_pix_mlp@@QAE@MM@Z) ann_pix_mlp error LNK2019: unresolved external symbol "__declspec(dllimport) private: static class ann_pix_mlp * __cdecl ann_pix_mlp::GetMyClass(void *)" (__imp_?GetMyClass@ann_pix_mlp@@CAPAV1@PAX@Z) referenced in function "private: static void __cdecl ann_pix_mlp::dimenMessCallback(void *,float,float)" (?dimenMessCallback@ann_pix_mlp@@CAXPAXMM@Z) ann_pix_mlp error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl ann_pix_mlp::obj_freeCallback(void *)" (__imp_?obj_freeCallback@ann_pix_mlp@@SAXPAX@Z) referenced in function _ann_pix_mlp_setup ann_pix_mlp error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl ann_pix_mlp::real_obj_setupCallback(struct _class *)" (__imp_?real_obj_setupCallback@ann_pix_mlp@@SAXPAU_class@@@Z) referenced in function _ann_pix_mlp_setup
I used [pix_resize] as template for my external
I downloaded GEM from cvs and compiled it (but had problems linking, GemLibs problems..) also downloaded Mesa
then I told my msvc project to use pd.lib GLU32.lib (form mesa) CPPExtern.obj Gembase.obj GemPixObj.obj GemPixUtil.obj
If I tell the preprocessor GEM_INTERNAL it links without problems, but (obviously) this is not the way to go.. (i get dllexport and I need dllimport, pd won't find my *_setup function)
Thank you, Davide.
----- Original Message ----- From: "Georg Holzmann" grhPD@gmx.at To: "Davide Morelli" info@davidemorelli.it Cc: "PD Lista" pd-list@iem.at Sent: Wednesday, June 15, 2005 12:34 PM Subject: Re: [PD] [GEM] pix_resize eating RAM
Hallo!
I am trying to resize a live video feed to a very small picture (16x12), extract a list of rgba values from this image and pass the list to ann_mlp.
just an idea: If you want to process the pixel data in a neural net I think it would be much faster if you write a GEM-external and process the data in C++ with fann (I did something similar a while ago ...), because maybe you'll need a lot of CPU :)
LG Georg
Hallo!
The easy way is: Simply write your pix_blabla.cpp file in the folder src/Pixex and the run the configure script again or add it to src/PixesMake.source.
Or you can make a GEM-external and the link it to Gem.pd_linux (or whatever) - I can send you an example makefile if you need (but only for linux ..)
LG Georg
Hallo!
Here are the examples: http://grh.mur.at/software/thebrain.html (some objects, which are also using a Neural Net in Gem, but not that sucessfull as I thought ...)
then I told my msvc project to use pd.lib GLU32.lib (form mesa) CPPExtern.obj Gembase.obj GemPixObj.obj GemPixUtil.obj
If I tell the preprocessor GEM_INTERNAL it links without problems, but (obviously) this is not the way to go.. (i get dllexport and I need dllimport, pd won't find my *_setup function)
Don't know how to make it with msvc, but maybe you make a nmake makefile or use MinGW, or try again with the msvc IDE ... :)
LG Georg