imtoolkit-users Mailing List for IM (Page 3)
Brought to you by:
scuri
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(3) |
Jun
(2) |
Jul
(11) |
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
(5) |
Oct
(1) |
Nov
|
Dec
(5) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Antonio S. <sc...@te...> - 2010-08-13 02:47:31
|
The weird thing is that read support is there. This is really a bug. Thanks for reporting and patching! Best Regards, Antonio Scuri From: Nicolas Noble [mailto:ni...@no...] Sent: quinta-feira, 12 de agosto de 2010 16:07 To: imt...@li... Subject: [Imtoolkit-users] Supporting Alpha in TGA files. Hello, I recently was surprised to discover that IM doesn't support writing TGA files that include an Alpha channel. I wrote a very simple patch for it, and it seems to be working fine, so I figured I'd share it. Cheers, -- Nicolas Noble --- <http://git.grumpycoder.net/cgi-bin/gitweb.cgi?p=lua-modules-iup;a=blob;f=im /src/im_format_tga.cpp;h=7c24a28a8d5f1ea1a500cba12b1534af0607006e> im/src/im_format_tga.cpp +++ <http://git.grumpycoder.net/cgi-bin/gitweb.cgi?p=lua-modules-iup;a=blob;f=im /src/im_format_tga.cpp;h=f15b25f0a91d61c4c32a370e712f0532a884375e;hb=0a44ec3 515eb9f7d2bed08cad79dff4d7524d818> im/src/im_format_tga.cpp @@ <http://git.grumpycoder.net/cgi-bin/gitweb.cgi?p=lua-modules-iup;a=blob;f=im /src/im_format_tga.cpp;h=7c24a28a8d5f1ea1a500cba12b1534af0607006e#l475> -475,7 <http://git.grumpycoder.net/cgi-bin/gitweb.cgi?p=lua-modules-iup;a=blob;f=im /src/im_format_tga.cpp;h=f15b25f0a91d61c4c32a370e712f0532a884375e;hb=0a44ec3 515eb9f7d2bed08cad79dff4d7524d818#l475> +475,13 @@ int imFileFormatTGA::WriteImageInfo() this->image_type = 1; break; case IM_RGB: - this->bpp = 24; + if (imColorModeHasAlpha(this->user_color_mode)) + { + this->bpp = 32; + this->file_color_mode |= IM_ALPHA; + } + else + this->bpp = 24; this->file_color_mode |= IM_PACKED; if (imStrEqual(this->compression, "RLE")) this->image_type = 10; |
From: Nicolas N. <ni...@no...> - 2010-08-12 20:10:24
|
Hello, I recently was surprised to discover that IM doesn't support writing TGA files that include an Alpha channel. I wrote a very simple patch for it, and it seems to be working fine, so I figured I'd share it. Cheers, -- Nicolas Noble --- im/src/im_format_tga.cpp<http://git.grumpycoder.net/cgi-bin/gitweb.cgi?p=lua-modules-iup;a=blob;f=im/src/im_format_tga.cpp;h=7c24a28a8d5f1ea1a500cba12b1534af0607006e> +++ im/src/im_format_tga.cpp<http://git.grumpycoder.net/cgi-bin/gitweb.cgi?p=lua-modules-iup;a=blob;f=im/src/im_format_tga.cpp;h=f15b25f0a91d61c4c32a370e712f0532a884375e;hb=0a44ec3515eb9f7d2bed08cad79dff4d7524d818> @@ -475,7<http://git.grumpycoder.net/cgi-bin/gitweb.cgi?p=lua-modules-iup;a=blob;f=im/src/im_format_tga.cpp;h=7c24a28a8d5f1ea1a500cba12b1534af0607006e#l475> +475,13<http://git.grumpycoder.net/cgi-bin/gitweb.cgi?p=lua-modules-iup;a=blob;f=im/src/im_format_tga.cpp;h=f15b25f0a91d61c4c32a370e712f0532a884375e;hb=0a44ec3515eb9f7d2bed08cad79dff4d7524d818#l475>@@ int imFileFormatTGA::WriteImageInfo() this->image_type = 1; break; case IM_RGB: - this->bpp = 24; + if (imColorModeHasAlpha(this->user_color_mode)) + { + this->bpp = 32; + this->file_color_mode |= IM_ALPHA; + } + else + this->bpp = 24; this->file_color_mode |= IM_PACKED; if (imStrEqual(this->compression, "RLE")) this->image_type = 10; |
From: Antonio S. <sc...@te...> - 2010-07-29 23:16:26
|
Ok! Thanks, Scuri From: cykt [mailto:cy...@aj...] Sent: quinta-feira, 29 de julho de 2010 11:56 To: 'IM discussion list.' Subject: Re: [Imtoolkit-users] im_capture doubt Hi, Scuri Now, it works. My webcam takes two loops to capture the image. For color mode parameter, I have changed to IM_BYTE|IM_RGB|IM_PACKED. Thanks a lot, for your prompt answer and valuable information. Id like to congratulate for your initiative to publish this great job. Best regards Luiz From: Antonio Scuri [mailto:sc...@te...] Sent: quarta-feira, 28 de julho de 2010 20:18 To: 'IM discussion list.' Subject: Re: [Imtoolkit-users] im_capture doubt Hi, The problem could be related to a hardware delay. Maybe you have to wait some time before trying to capture a frame right after you connect, in other words between imVideoCaptureConnect and imVideoCaptureOneFrame you should delay some time. Another option is to try to capture a few times before giving up. I mean, call imVideoCaptureOneFrame inside a small loop until it returns a non zero value, then break the loop. If all attempts failed then print the error. By the way, dont use 1 as a parameter, use the definitions in im.h that describes a color mode. Best, scuri From: cykt [mailto:cy...@aj...] Sent: quarta-feira, 28 de julho de 2010 18:23 To: imt...@li... Subject: [Imtoolkit-users] im_capture doubt Hi, Im trying to use im_capture library in order to capture one frame from USB 2.0 webcam (640x480 resolution). I have followed capture guide basic program exactly the same way is written in the document. I mean: void capturaCamera(unsigned char *pImage) { imVideoCapture* vc = imVideoCaptureCreate(); if (vc == NULL) printf ("\nCreation error"); if (!imVideoCaptureConnect(vc, 0)){ printf ("\nConnection Error"); } int width=0, height=0; imVideoCaptureGetImageSize(vc, &width, &height); printf ("\n width = %d, height = %d", width, height ); if (!imVideoCaptureOneFrame(vc, pImage, 1)) printf ("\nCapture Error"); imVideoCaptureDisconnect(vc); imVideoCaptureDestroy(vc); } It works until imVideoCaptureOneFrame() procedure. But here, it returns a NULL value. Im using Windows Vista Home, Eclipse CDT, MingW 3.4.5. The program is written in C language. I have already tested imVideoCaptureLive() and imVideoCaptureFrame() functions, but the results was the same. Also, I have tested imVideoCaptureReloadDevices(), aiming to clear device, but no result. I have tested webcam using the following applications: AMcap and ÑAUSA (which uses im library). And it works well. What is wrong ? Thanks in advance Luiz Nenhum vírus encontrado nessa mensagem recebida. Verificado por AVG - www.avgbrasil.com.br Versão: 9.0.851 / Banco de dados de vírus: 271.1.1/3035 - Data de Lançamento: 07/28/10 14:38:00 |
From: cykt <cy...@aj...> - 2010-07-29 15:23:36
|
Hi, Scuri Now, it works. My webcam takes two loops to capture the image. For color mode parameter, I have changed to IM_BYTE|IM_RGB|IM_PACKED. Thanks a lot, for your prompt answer and valuable information. Id like to congratulate for your initiative to publish this great job. Best regards Luiz From: Antonio Scuri [mailto:sc...@te...] Sent: quarta-feira, 28 de julho de 2010 20:18 To: 'IM discussion list.' Subject: Re: [Imtoolkit-users] im_capture doubt Hi, The problem could be related to a hardware delay. Maybe you have to wait some time before trying to capture a frame right after you connect, in other words between imVideoCaptureConnect and imVideoCaptureOneFrame you should delay some time. Another option is to try to capture a few times before giving up. I mean, call imVideoCaptureOneFrame inside a small loop until it returns a non zero value, then break the loop. If all attempts failed then print the error. By the way, dont use 1 as a parameter, use the definitions in im.h that describes a color mode. Best, scuri From: cykt [mailto:cy...@aj...] Sent: quarta-feira, 28 de julho de 2010 18:23 To: imt...@li... Subject: [Imtoolkit-users] im_capture doubt Hi, Im trying to use im_capture library in order to capture one frame from USB 2.0 webcam (640x480 resolution). I have followed capture guide basic program exactly the same way is written in the document. I mean: void capturaCamera(unsigned char *pImage) { imVideoCapture* vc = imVideoCaptureCreate(); if (vc == NULL) printf ("\nCreation error"); if (!imVideoCaptureConnect(vc, 0)){ printf ("\nConnection Error"); } int width=0, height=0; imVideoCaptureGetImageSize(vc, &width, &height); printf ("\n width = %d, height = %d", width, height ); if (!imVideoCaptureOneFrame(vc, pImage, 1)) printf ("\nCapture Error"); imVideoCaptureDisconnect(vc); imVideoCaptureDestroy(vc); } It works until imVideoCaptureOneFrame() procedure. But here, it returns a NULL value. Im using Windows Vista Home, Eclipse CDT, MingW 3.4.5. The program is written in C language. I have already tested imVideoCaptureLive() and imVideoCaptureFrame() functions, but the results was the same. Also, I have tested imVideoCaptureReloadDevices(), aiming to clear device, but no result. I have tested webcam using the following applications: AMcap and ÑAUSA (which uses im library). And it works well. What is wrong ? Thanks in advance Luiz Nenhum vírus encontrado nessa mensagem recebida. Verificado por AVG - www.avgbrasil.com.br Versão: 9.0.851 / Banco de dados de vírus: 271.1.1/3035 - Data de Lançamento: 07/28/10 14:38:00 |
From: Antonio S. <sc...@te...> - 2010-07-28 23:30:43
|
Hi, The problem could be related to a hardware delay. Maybe you have to wait some time before trying to capture a frame right after you connect, in other words between imVideoCaptureConnect and imVideoCaptureOneFrame you should delay some time. Another option is to try to capture a few times before giving up. I mean, call imVideoCaptureOneFrame inside a small loop until it returns a non zero value, then break the loop. If all attempts failed then print the error. By the way, dont use 1 as a parameter, use the definitions in im.h that describes a color mode. Best, scuri From: cykt [mailto:cy...@aj...] Sent: quarta-feira, 28 de julho de 2010 18:23 To: imt...@li... Subject: [Imtoolkit-users] im_capture doubt Hi, Im trying to use im_capture library in order to capture one frame from USB 2.0 webcam (640x480 resolution). I have followed capture guide basic program exactly the same way is written in the document. I mean: void capturaCamera(unsigned char *pImage) { imVideoCapture* vc = imVideoCaptureCreate(); if (vc == NULL) printf ("\nCreation error"); if (!imVideoCaptureConnect(vc, 0)){ printf ("\nConnection Error"); } int width=0, height=0; imVideoCaptureGetImageSize(vc, &width, &height); printf ("\n width = %d, height = %d", width, height ); if (!imVideoCaptureOneFrame(vc, pImage, 1)) printf ("\nCapture Error"); imVideoCaptureDisconnect(vc); imVideoCaptureDestroy(vc); } It works until imVideoCaptureOneFrame() procedure. But here, it returns a NULL value. Im using Windows Vista Home, Eclipse CDT, MingW 3.4.5. The program is written in C language. I have already tested imVideoCaptureLive() and imVideoCaptureFrame() functions, but the results was the same. Also, I have tested imVideoCaptureReloadDevices(), aiming to clear device, but no result. I have tested webcam using the following applications: AMcap and ÑAUSA (which uses im library). And it works well. What is wrong ? Thanks in advance Luiz |
From: cykt <cy...@aj...> - 2010-07-28 21:23:17
|
Hi, Im trying to use im_capture library in order to capture one frame from USB 2.0 webcam (640x480 resolution). I have followed capture guide basic program exactly the same way is written in the document. I mean: void capturaCamera(unsigned char *pImage) { imVideoCapture* vc = imVideoCaptureCreate(); if (vc == NULL) printf ("\nCreation error"); if (!imVideoCaptureConnect(vc, 0)){ printf ("\nConnection Error"); } int width=0, height=0; imVideoCaptureGetImageSize(vc, &width, &height); printf ("\n width = %d, height = %d", width, height ); if (!imVideoCaptureOneFrame(vc, pImage, 1)) printf ("\nCapture Error"); imVideoCaptureDisconnect(vc); imVideoCaptureDestroy(vc); } It works until imVideoCaptureOneFrame() procedure. But here, it returns a NULL value. Im using Windows Vista Home, Eclipse CDT, MingW 3.4.5. The program is written in C language. I have already tested imVideoCaptureLive() and imVideoCaptureFrame() functions, but the results was the same. Also, I have tested imVideoCaptureReloadDevices(), aiming to clear device, but no result. I have tested webcam using the following applications: AMcap and ÑAUSA (which uses im library). And it works well. What is wrong ? Thanks in advance Luiz |
From: DONGIEUX-AKKA C. (S. D. SECURITE)
<chr...@sa...> - 2010-07-26 07:20:36
|
Thanks a lot Antonio, I'll try that. Chris. ________________________________________ De : Antonio Scuri [sc...@te...] Date d'envoi : vendredi 23 juillet 2010 18:10 À : 'IM discussion list.' Objet : Re: [Imtoolkit-users] RE : RE : IM C++ bindings to Lua Sure, here is a very simple implementation of a IM function in Lua: static int imluaKernelSobel(lua_State *L) { imlua_pushimage(L, imKernelSobel()); return 1; } static const luaL_reg imkernel_lib[] = { {"KernelSobel", imluaKernelSobel}, ... {NULL, NULL} }; ... luaL_register(L, NULL, imkernel_lib); ... Since you are using LuaBind I don't know how to help you, but maybe there is a way how to tell to LuaBind what kind of object is that. Best, scuri Here is another one: static int imluaImageClone (lua_State *L) { imImage* image = imlua_checkimage(L, 1); imImage *new_image = imImageClone(image); imlua_pushimage(L, new_image); return 1; } > -----Original Message----- > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > [mailto:chr...@sa...] > Sent: sexta-feira, 23 de julho de 2010 10:15 > To: IM discussion list. > Subject: [Imtoolkit-users] RE : RE : IM C++ bindings to Lua > > Yes, that's exactly the problem, getImage returns the pointer as > userdata. > > Concerning imlua_pushimage, I saw that function in the header, but as I > am quite new to Lua, I don't know exactly how to use it. > Could you give me an example? > > Thanks a lot for your answers. > Chris. > > ________________________________________ > De : Antonio Scuri [sc...@te...] > Date d'envoi : vendredi 23 juillet 2010 14:28 > À : 'IM discussion list.' > Objet : Re: [Imtoolkit-users] RE : IM C++ bindings to Lua > > Yes, the problem is probably in getImage when return the imImage to > Lua. I > don't know LuaBind but it will probably return the imImage pointer as > an > userdata, and it should return as an imImage Lua object created by > ImLua. > Maybe it has some way to do that. > > ImLua actually exports functions in C to do that, see "imlua.h" and > imlua_pushimage. > > Best, > scuri > > > -----Original Message----- > > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > > [mailto:chr...@sa...] > > Sent: sexta-feira, 23 de julho de 2010 03:42 > > To: IM discussion list. > > Subject: [Imtoolkit-users] RE : IM C++ bindings to Lua > > > > Hi Antonio, > > > > No, there is no inheritance from the imImage structure, I just wanted > > to say that I want to "improve" my software by adding image > treatments > > executed from Lua. > > I tried to do something like that, but I couldn't make it work, maybe > > you could give my some hints: > > > > // in C++ > > class Foo > > { > > public: > > Foo(); > > { > > p_img = imImageCreate( ... ); > > } > > imImage* getImage() > > { > > return p_img; > > } > > }; > > > > ... > > // I init the imLua libraries > > imlua_open( L); > > imlua_open_fftw( L); > > imlua_open_process( L); > > ... > > // I expose my Foo class to Lua with Luabind > > luabind::module( L ) [ > > > > luabind::class_< Foo>( "Foo" ) > > .def( luabind::constructor<>() ) > > .def( "getImage", &Foo::getImage) > > > > ]; > > ... > > // I execute the below Lua script > > luaL_dofile( pState, "testIM.lua" ); > > // this function returns an error : "std::runtime_error: 'Trying to > use > > unregistered class'" > > > > > > // the Lua script: > > f = Foo() > > img = f:getImage() > > im.ImageMakeBinary( img ) > > > > > > Do you have an idea of what is the problem and how could I do to > solve > > it? > > > > Regards, > > Chris. > > ________________________________________ > > De : Antonio Scuri [sc...@te...] > > Date d'envoi : jeudi 22 juillet 2010 18:51 > > À : 'IM discussion list.' > > Objet : Re: [Imtoolkit-users] IM C++ bindings to Lua > > > > Hi Chris, > > > > ImLua already expose the imImage structure to Lua. Are you saying > > that you created a class that inherit from the imImage structure in > C++ > > to extend it? > > > > Anyway, in ImLua the image data is still stored in C/C++, it is not > > duplicated in Lua. > > > > If you create algorithms in Lua by combining IM functions then the > > cost is very low. But to implement the algorithm in Lua accessing > image > > pixels it will be very slow. > > > > Best Regards, > > Antonio Scuri > > > > > -----Original Message----- > > > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > > > [mailto:chr...@sa...] > > > Sent: quinta-feira, 22 de julho de 2010 10:03 > > > To: imt...@li... > > > Subject: [Imtoolkit-users] IM C++ bindings to Lua > > > > > > Hello, > > > > > > I am writing a C++ program to display some image processed videos. > My > > > program has some basic image processing functions available through > > IM, > > > but I'd like to extend it thanks to Lua/imLua. > > > IM is working in C++ and Lua, so I'd like to expose my imImage > > instance > > > in C++ to Lua, make some treatments, and then go back to C++ to > > display > > > it. > > > Do you think it's possible? (I already know how to do bindings > thanks > > > to Luabind) > > > Will the data buffer contained in the C++ part of the imImage > > instance > > > be copied to the Lua world, or will C++ and Lua (imLua) share the > > same > > > memory zone? > > > What CPU and memory will it cost compared to C++ only image > > processing > > > with imLua? > > > > > > Thanks in advance, > > > Chris. > > > # > > > " Ce courriel et les documents qui lui sont joints peuvent contenir > > des > > > informations confidentielles ou ayant un caractère privé. S'ils ne > > vous > > > sont > > > pas destinés, nous vous signalons qu'il est strictement interdit de > > les > > > divulguer, de les reproduire ou d'en utiliser de quelque manière > que > > ce > > > soit le contenu. Si ce message vous a été transmis par erreur, > merci > > > d'en > > > informer l'expéditeur et de supprimer immédiatement de votre > système > > > informatique ce courriel ainsi que tous les documents qui y sont > > > attachés." > > > > ****** > > > " This e-mail and any attached documents may contain confidential > or > > > proprietary information. If you are not the intended recipient, you > > are > > > notified that any dissemination, copying of this e-mail and any > > > attachments > > > thereto or use of their contents by any means whatsoever is > strictly > > > prohibited. If you have received this e-mail in error, please > advise > > > the > > > sender immediately and delete this e-mail and all attached > documents > > > from your computer system." > > > # > > > ------------------------------------------------------------------- > -- > > -- > > > ------- > > > This SF.net email is sponsored by Sprint > > > What will you do first with EVO, the first 4G phone? > > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > > _______________________________________________ > > > Imtoolkit-users mailing list > > > Imt...@li... > > > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > > > > > --------------------------------------------------------------------- > -- > > ------- > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Imtoolkit-users mailing list > > Imt...@li... > > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > # > > " Ce courriel et les documents qui lui sont joints peuvent contenir > des > > informations confidentielles ou ayant un caractère privé. S'ils ne > vous > > sont > > pas destinés, nous vous signalons qu'il est strictement interdit de > les > > divulguer, de les reproduire ou d'en utiliser de quelque manière que > ce > > soit le contenu. Si ce message vous a été transmis par erreur, merci > > d'en > > informer l'expéditeur et de supprimer immédiatement de votre système > > informatique ce courriel ainsi que tous les documents qui y sont > > attachés." > > ****** > > " This e-mail and any attached documents may contain confidential or > > proprietary information. If you are not the intended recipient, you > are > > notified that any dissemination, copying of this e-mail and any > > attachments > > thereto or use of their contents by any means whatsoever is strictly > > prohibited. If you have received this e-mail in error, please advise > > the > > sender immediately and delete this e-mail and all attached documents > > from your computer system." > > # > > > > > > --------------------------------------------------------------------- > -- > > ------- > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Imtoolkit-users mailing list > > Imt...@li... > > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > # > " Ce courriel et les documents qui lui sont joints peuvent contenir des > informations confidentielles ou ayant un caractère privé. S'ils ne vous > sont pas destinés, nous vous signalons qu'il est strictement interdit > de les divulguer, de les reproduire ou d'en utiliser de quelque manière > que ce soit le contenu. Si ce message vous a été transmis par erreur, > merci d'en informer l'expéditeur et de supprimer immédiatement de votre > système informatique ce courriel ainsi que tous les documents qui y > sont attachés." > > ****** > " This e-mail and any attached documents may contain confidential or > proprietary information. If you are not the intended recipient, you are > notified that any dissemination, copying of this e-mail and any > attachments thereto or use of their contents by any means whatsoever is > strictly prohibited. If you have received this e-mail in error, please > advise the sender immediately and delete this e-mail and all attached > documents from your computer system." > # > > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Imtoolkit-users mailing list Imt...@li... https://lists.sourceforge.net/lists/listinfo/imtoolkit-users # " Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles ou ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés." ****** " This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system." # |
From: Antonio S. <sc...@te...> - 2010-07-23 16:11:16
|
Sure, here is a very simple implementation of a IM function in Lua: static int imluaKernelSobel(lua_State *L) { imlua_pushimage(L, imKernelSobel()); return 1; } static const luaL_reg imkernel_lib[] = { {"KernelSobel", imluaKernelSobel}, ... {NULL, NULL} }; ... luaL_register(L, NULL, imkernel_lib); ... Since you are using LuaBind I don't know how to help you, but maybe there is a way how to tell to LuaBind what kind of object is that. Best, scuri Here is another one: static int imluaImageClone (lua_State *L) { imImage* image = imlua_checkimage(L, 1); imImage *new_image = imImageClone(image); imlua_pushimage(L, new_image); return 1; } > -----Original Message----- > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > [mailto:chr...@sa...] > Sent: sexta-feira, 23 de julho de 2010 10:15 > To: IM discussion list. > Subject: [Imtoolkit-users] RE : RE : IM C++ bindings to Lua > > Yes, that's exactly the problem, getImage returns the pointer as > userdata. > > Concerning imlua_pushimage, I saw that function in the header, but as I > am quite new to Lua, I don't know exactly how to use it. > Could you give me an example? > > Thanks a lot for your answers. > Chris. > > ________________________________________ > De : Antonio Scuri [sc...@te...] > Date d'envoi : vendredi 23 juillet 2010 14:28 > À : 'IM discussion list.' > Objet : Re: [Imtoolkit-users] RE : IM C++ bindings to Lua > > Yes, the problem is probably in getImage when return the imImage to > Lua. I > don't know LuaBind but it will probably return the imImage pointer as > an > userdata, and it should return as an imImage Lua object created by > ImLua. > Maybe it has some way to do that. > > ImLua actually exports functions in C to do that, see "imlua.h" and > imlua_pushimage. > > Best, > scuri > > > -----Original Message----- > > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > > [mailto:chr...@sa...] > > Sent: sexta-feira, 23 de julho de 2010 03:42 > > To: IM discussion list. > > Subject: [Imtoolkit-users] RE : IM C++ bindings to Lua > > > > Hi Antonio, > > > > No, there is no inheritance from the imImage structure, I just wanted > > to say that I want to "improve" my software by adding image > treatments > > executed from Lua. > > I tried to do something like that, but I couldn't make it work, maybe > > you could give my some hints: > > > > // in C++ > > class Foo > > { > > public: > > Foo(); > > { > > p_img = imImageCreate( ... ); > > } > > imImage* getImage() > > { > > return p_img; > > } > > }; > > > > ... > > // I init the imLua libraries > > imlua_open( L); > > imlua_open_fftw( L); > > imlua_open_process( L); > > ... > > // I expose my Foo class to Lua with Luabind > > luabind::module( L ) [ > > > > luabind::class_< Foo>( "Foo" ) > > .def( luabind::constructor<>() ) > > .def( "getImage", &Foo::getImage) > > > > ]; > > ... > > // I execute the below Lua script > > luaL_dofile( pState, "testIM.lua" ); > > // this function returns an error : "std::runtime_error: 'Trying to > use > > unregistered class'" > > > > > > // the Lua script: > > f = Foo() > > img = f:getImage() > > im.ImageMakeBinary( img ) > > > > > > Do you have an idea of what is the problem and how could I do to > solve > > it? > > > > Regards, > > Chris. > > ________________________________________ > > De : Antonio Scuri [sc...@te...] > > Date d'envoi : jeudi 22 juillet 2010 18:51 > > À : 'IM discussion list.' > > Objet : Re: [Imtoolkit-users] IM C++ bindings to Lua > > > > Hi Chris, > > > > ImLua already expose the imImage structure to Lua. Are you saying > > that you created a class that inherit from the imImage structure in > C++ > > to extend it? > > > > Anyway, in ImLua the image data is still stored in C/C++, it is not > > duplicated in Lua. > > > > If you create algorithms in Lua by combining IM functions then the > > cost is very low. But to implement the algorithm in Lua accessing > image > > pixels it will be very slow. > > > > Best Regards, > > Antonio Scuri > > > > > -----Original Message----- > > > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > > > [mailto:chr...@sa...] > > > Sent: quinta-feira, 22 de julho de 2010 10:03 > > > To: imt...@li... > > > Subject: [Imtoolkit-users] IM C++ bindings to Lua > > > > > > Hello, > > > > > > I am writing a C++ program to display some image processed videos. > My > > > program has some basic image processing functions available through > > IM, > > > but I'd like to extend it thanks to Lua/imLua. > > > IM is working in C++ and Lua, so I'd like to expose my imImage > > instance > > > in C++ to Lua, make some treatments, and then go back to C++ to > > display > > > it. > > > Do you think it's possible? (I already know how to do bindings > thanks > > > to Luabind) > > > Will the data buffer contained in the C++ part of the imImage > > instance > > > be copied to the Lua world, or will C++ and Lua (imLua) share the > > same > > > memory zone? > > > What CPU and memory will it cost compared to C++ only image > > processing > > > with imLua? > > > > > > Thanks in advance, > > > Chris. > > > # > > > " Ce courriel et les documents qui lui sont joints peuvent contenir > > des > > > informations confidentielles ou ayant un caractère privé. S'ils ne > > vous > > > sont > > > pas destinés, nous vous signalons qu'il est strictement interdit de > > les > > > divulguer, de les reproduire ou d'en utiliser de quelque manière > que > > ce > > > soit le contenu. Si ce message vous a été transmis par erreur, > merci > > > d'en > > > informer l'expéditeur et de supprimer immédiatement de votre > système > > > informatique ce courriel ainsi que tous les documents qui y sont > > > attachés." > > > > ****** > > > " This e-mail and any attached documents may contain confidential > or > > > proprietary information. If you are not the intended recipient, you > > are > > > notified that any dissemination, copying of this e-mail and any > > > attachments > > > thereto or use of their contents by any means whatsoever is > strictly > > > prohibited. If you have received this e-mail in error, please > advise > > > the > > > sender immediately and delete this e-mail and all attached > documents > > > from your computer system." > > > # > > > ------------------------------------------------------------------- > -- > > -- > > > ------- > > > This SF.net email is sponsored by Sprint > > > What will you do first with EVO, the first 4G phone? > > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > > _______________________________________________ > > > Imtoolkit-users mailing list > > > Imt...@li... > > > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > > > > > --------------------------------------------------------------------- > -- > > ------- > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Imtoolkit-users mailing list > > Imt...@li... > > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > # > > " Ce courriel et les documents qui lui sont joints peuvent contenir > des > > informations confidentielles ou ayant un caractère privé. S'ils ne > vous > > sont > > pas destinés, nous vous signalons qu'il est strictement interdit de > les > > divulguer, de les reproduire ou d'en utiliser de quelque manière que > ce > > soit le contenu. Si ce message vous a été transmis par erreur, merci > > d'en > > informer l'expéditeur et de supprimer immédiatement de votre système > > informatique ce courriel ainsi que tous les documents qui y sont > > attachés." > > ****** > > " This e-mail and any attached documents may contain confidential or > > proprietary information. If you are not the intended recipient, you > are > > notified that any dissemination, copying of this e-mail and any > > attachments > > thereto or use of their contents by any means whatsoever is strictly > > prohibited. If you have received this e-mail in error, please advise > > the > > sender immediately and delete this e-mail and all attached documents > > from your computer system." > > # > > > > > > --------------------------------------------------------------------- > -- > > ------- > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Imtoolkit-users mailing list > > Imt...@li... > > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > # > " Ce courriel et les documents qui lui sont joints peuvent contenir des > informations confidentielles ou ayant un caractère privé. S'ils ne vous > sont pas destinés, nous vous signalons qu'il est strictement interdit > de les divulguer, de les reproduire ou d'en utiliser de quelque manière > que ce soit le contenu. Si ce message vous a été transmis par erreur, > merci d'en informer l'expéditeur et de supprimer immédiatement de votre > système informatique ce courriel ainsi que tous les documents qui y > sont attachés." > > ****** > " This e-mail and any attached documents may contain confidential or > proprietary information. If you are not the intended recipient, you are > notified that any dissemination, copying of this e-mail and any > attachments thereto or use of their contents by any means whatsoever is > strictly prohibited. If you have received this e-mail in error, please > advise the sender immediately and delete this e-mail and all attached > documents from your computer system." > # > > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users |
From: DONGIEUX-AKKA C. (S. D. SECURITE)
<chr...@sa...> - 2010-07-23 13:26:40
|
Yes, that's exactly the problem, getImage returns the pointer as userdata. Concerning imlua_pushimage, I saw that function in the header, but as I am quite new to Lua, I don't know exactly how to use it. Could you give me an example? Thanks a lot for your answers. Chris. ________________________________________ De : Antonio Scuri [sc...@te...] Date d'envoi : vendredi 23 juillet 2010 14:28 À : 'IM discussion list.' Objet : Re: [Imtoolkit-users] RE : IM C++ bindings to Lua Yes, the problem is probably in getImage when return the imImage to Lua. I don't know LuaBind but it will probably return the imImage pointer as an userdata, and it should return as an imImage Lua object created by ImLua. Maybe it has some way to do that. ImLua actually exports functions in C to do that, see "imlua.h" and imlua_pushimage. Best, scuri > -----Original Message----- > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > [mailto:chr...@sa...] > Sent: sexta-feira, 23 de julho de 2010 03:42 > To: IM discussion list. > Subject: [Imtoolkit-users] RE : IM C++ bindings to Lua > > Hi Antonio, > > No, there is no inheritance from the imImage structure, I just wanted > to say that I want to "improve" my software by adding image treatments > executed from Lua. > I tried to do something like that, but I couldn't make it work, maybe > you could give my some hints: > > // in C++ > class Foo > { > public: > Foo(); > { > p_img = imImageCreate( ... ); > } > imImage* getImage() > { > return p_img; > } > }; > > ... > // I init the imLua libraries > imlua_open( L); > imlua_open_fftw( L); > imlua_open_process( L); > ... > // I expose my Foo class to Lua with Luabind > luabind::module( L ) [ > > luabind::class_< Foo>( "Foo" ) > .def( luabind::constructor<>() ) > .def( "getImage", &Foo::getImage) > > ]; > ... > // I execute the below Lua script > luaL_dofile( pState, "testIM.lua" ); > // this function returns an error : "std::runtime_error: 'Trying to use > unregistered class'" > > > // the Lua script: > f = Foo() > img = f:getImage() > im.ImageMakeBinary( img ) > > > Do you have an idea of what is the problem and how could I do to solve > it? > > Regards, > Chris. > ________________________________________ > De : Antonio Scuri [sc...@te...] > Date d'envoi : jeudi 22 juillet 2010 18:51 > À : 'IM discussion list.' > Objet : Re: [Imtoolkit-users] IM C++ bindings to Lua > > Hi Chris, > > ImLua already expose the imImage structure to Lua. Are you saying > that you created a class that inherit from the imImage structure in C++ > to extend it? > > Anyway, in ImLua the image data is still stored in C/C++, it is not > duplicated in Lua. > > If you create algorithms in Lua by combining IM functions then the > cost is very low. But to implement the algorithm in Lua accessing image > pixels it will be very slow. > > Best Regards, > Antonio Scuri > > > -----Original Message----- > > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > > [mailto:chr...@sa...] > > Sent: quinta-feira, 22 de julho de 2010 10:03 > > To: imt...@li... > > Subject: [Imtoolkit-users] IM C++ bindings to Lua > > > > Hello, > > > > I am writing a C++ program to display some image processed videos. My > > program has some basic image processing functions available through > IM, > > but I'd like to extend it thanks to Lua/imLua. > > IM is working in C++ and Lua, so I'd like to expose my imImage > instance > > in C++ to Lua, make some treatments, and then go back to C++ to > display > > it. > > Do you think it's possible? (I already know how to do bindings thanks > > to Luabind) > > Will the data buffer contained in the C++ part of the imImage > instance > > be copied to the Lua world, or will C++ and Lua (imLua) share the > same > > memory zone? > > What CPU and memory will it cost compared to C++ only image > processing > > with imLua? > > > > Thanks in advance, > > Chris. > > # > > " Ce courriel et les documents qui lui sont joints peuvent contenir > des > > informations confidentielles ou ayant un caractère privé. S'ils ne > vous > > sont > > pas destinés, nous vous signalons qu'il est strictement interdit de > les > > divulguer, de les reproduire ou d'en utiliser de quelque manière que > ce > > soit le contenu. Si ce message vous a été transmis par erreur, merci > > d'en > > informer l'expéditeur et de supprimer immédiatement de votre système > > informatique ce courriel ainsi que tous les documents qui y sont > > attachés." > > ****** > > " This e-mail and any attached documents may contain confidential or > > proprietary information. If you are not the intended recipient, you > are > > notified that any dissemination, copying of this e-mail and any > > attachments > > thereto or use of their contents by any means whatsoever is strictly > > prohibited. If you have received this e-mail in error, please advise > > the > > sender immediately and delete this e-mail and all attached documents > > from your computer system." > > # > > --------------------------------------------------------------------- > -- > > ------- > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Imtoolkit-users mailing list > > Imt...@li... > > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > # > " Ce courriel et les documents qui lui sont joints peuvent contenir des > informations confidentielles ou ayant un caractère privé. S'ils ne vous > sont > pas destinés, nous vous signalons qu'il est strictement interdit de les > divulguer, de les reproduire ou d'en utiliser de quelque manière que ce > soit le contenu. Si ce message vous a été transmis par erreur, merci > d'en > informer l'expéditeur et de supprimer immédiatement de votre système > informatique ce courriel ainsi que tous les documents qui y sont > attachés." > ****** > " This e-mail and any attached documents may contain confidential or > proprietary information. If you are not the intended recipient, you are > notified that any dissemination, copying of this e-mail and any > attachments > thereto or use of their contents by any means whatsoever is strictly > prohibited. If you have received this e-mail in error, please advise > the > sender immediately and delete this e-mail and all attached documents > from your computer system." > # > > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Imtoolkit-users mailing list Imt...@li... https://lists.sourceforge.net/lists/listinfo/imtoolkit-users # " Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles ou ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés." ****** " This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system." # |
From: Antonio S. <sc...@te...> - 2010-07-23 12:29:10
|
Yes, the problem is probably in getImage when return the imImage to Lua. I don't know LuaBind but it will probably return the imImage pointer as an userdata, and it should return as an imImage Lua object created by ImLua. Maybe it has some way to do that. ImLua actually exports functions in C to do that, see "imlua.h" and imlua_pushimage. Best, scuri > -----Original Message----- > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > [mailto:chr...@sa...] > Sent: sexta-feira, 23 de julho de 2010 03:42 > To: IM discussion list. > Subject: [Imtoolkit-users] RE : IM C++ bindings to Lua > > Hi Antonio, > > No, there is no inheritance from the imImage structure, I just wanted > to say that I want to "improve" my software by adding image treatments > executed from Lua. > I tried to do something like that, but I couldn't make it work, maybe > you could give my some hints: > > // in C++ > class Foo > { > public: > Foo(); > { > p_img = imImageCreate( ... ); > } > imImage* getImage() > { > return p_img; > } > }; > > ... > // I init the imLua libraries > imlua_open( L); > imlua_open_fftw( L); > imlua_open_process( L); > ... > // I expose my Foo class to Lua with Luabind > luabind::module( L ) [ > > luabind::class_< Foo>( "Foo" ) > .def( luabind::constructor<>() ) > .def( "getImage", &Foo::getImage) > > ]; > ... > // I execute the below Lua script > luaL_dofile( pState, "testIM.lua" ); > // this function returns an error : "std::runtime_error: 'Trying to use > unregistered class'" > > > // the Lua script: > f = Foo() > img = f:getImage() > im.ImageMakeBinary( img ) > > > Do you have an idea of what is the problem and how could I do to solve > it? > > Regards, > Chris. > ________________________________________ > De : Antonio Scuri [sc...@te...] > Date d'envoi : jeudi 22 juillet 2010 18:51 > À : 'IM discussion list.' > Objet : Re: [Imtoolkit-users] IM C++ bindings to Lua > > Hi Chris, > > ImLua already expose the imImage structure to Lua. Are you saying > that you created a class that inherit from the imImage structure in C++ > to extend it? > > Anyway, in ImLua the image data is still stored in C/C++, it is not > duplicated in Lua. > > If you create algorithms in Lua by combining IM functions then the > cost is very low. But to implement the algorithm in Lua accessing image > pixels it will be very slow. > > Best Regards, > Antonio Scuri > > > -----Original Message----- > > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > > [mailto:chr...@sa...] > > Sent: quinta-feira, 22 de julho de 2010 10:03 > > To: imt...@li... > > Subject: [Imtoolkit-users] IM C++ bindings to Lua > > > > Hello, > > > > I am writing a C++ program to display some image processed videos. My > > program has some basic image processing functions available through > IM, > > but I'd like to extend it thanks to Lua/imLua. > > IM is working in C++ and Lua, so I'd like to expose my imImage > instance > > in C++ to Lua, make some treatments, and then go back to C++ to > display > > it. > > Do you think it's possible? (I already know how to do bindings thanks > > to Luabind) > > Will the data buffer contained in the C++ part of the imImage > instance > > be copied to the Lua world, or will C++ and Lua (imLua) share the > same > > memory zone? > > What CPU and memory will it cost compared to C++ only image > processing > > with imLua? > > > > Thanks in advance, > > Chris. > > # > > " Ce courriel et les documents qui lui sont joints peuvent contenir > des > > informations confidentielles ou ayant un caractère privé. S'ils ne > vous > > sont > > pas destinés, nous vous signalons qu'il est strictement interdit de > les > > divulguer, de les reproduire ou d'en utiliser de quelque manière que > ce > > soit le contenu. Si ce message vous a été transmis par erreur, merci > > d'en > > informer l'expéditeur et de supprimer immédiatement de votre système > > informatique ce courriel ainsi que tous les documents qui y sont > > attachés." > > ****** > > " This e-mail and any attached documents may contain confidential or > > proprietary information. If you are not the intended recipient, you > are > > notified that any dissemination, copying of this e-mail and any > > attachments > > thereto or use of their contents by any means whatsoever is strictly > > prohibited. If you have received this e-mail in error, please advise > > the > > sender immediately and delete this e-mail and all attached documents > > from your computer system." > > # > > --------------------------------------------------------------------- > -- > > ------- > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Imtoolkit-users mailing list > > Imt...@li... > > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > # > " Ce courriel et les documents qui lui sont joints peuvent contenir des > informations confidentielles ou ayant un caractère privé. S'ils ne vous > sont > pas destinés, nous vous signalons qu'il est strictement interdit de les > divulguer, de les reproduire ou d'en utiliser de quelque manière que ce > soit le contenu. Si ce message vous a été transmis par erreur, merci > d'en > informer l'expéditeur et de supprimer immédiatement de votre système > informatique ce courriel ainsi que tous les documents qui y sont > attachés." > ****** > " This e-mail and any attached documents may contain confidential or > proprietary information. If you are not the intended recipient, you are > notified that any dissemination, copying of this e-mail and any > attachments > thereto or use of their contents by any means whatsoever is strictly > prohibited. If you have received this e-mail in error, please advise > the > sender immediately and delete this e-mail and all attached documents > from your computer system." > # > > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users |
From: DONGIEUX-AKKA C. (S. D. SECURITE)
<chr...@sa...> - 2010-07-23 06:47:27
|
Hi Antonio, No, there is no inheritance from the imImage structure, I just wanted to say that I want to "improve" my software by adding image treatments executed from Lua. I tried to do something like that, but I couldn't make it work, maybe you could give my some hints: // in C++ class Foo { public: Foo(); { p_img = imImageCreate( ... ); } imImage* getImage() { return p_img; } }; ... // I init the imLua libraries imlua_open( L); imlua_open_fftw( L); imlua_open_process( L); ... // I expose my Foo class to Lua with Luabind luabind::module( L ) [ luabind::class_< Foo>( "Foo" ) .def( luabind::constructor<>() ) .def( "getImage", &Foo::getImage) ]; ... // I execute the below Lua script luaL_dofile( pState, "testIM.lua" ); // this function returns an error : "std::runtime_error: 'Trying to use unregistered class'" // the Lua script: f = Foo() img = f:getImage() im.ImageMakeBinary( img ) Do you have an idea of what is the problem and how could I do to solve it? Regards, Chris. ________________________________________ De : Antonio Scuri [sc...@te...] Date d'envoi : jeudi 22 juillet 2010 18:51 À : 'IM discussion list.' Objet : Re: [Imtoolkit-users] IM C++ bindings to Lua Hi Chris, ImLua already expose the imImage structure to Lua. Are you saying that you created a class that inherit from the imImage structure in C++ to extend it? Anyway, in ImLua the image data is still stored in C/C++, it is not duplicated in Lua. If you create algorithms in Lua by combining IM functions then the cost is very low. But to implement the algorithm in Lua accessing image pixels it will be very slow. Best Regards, Antonio Scuri > -----Original Message----- > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > [mailto:chr...@sa...] > Sent: quinta-feira, 22 de julho de 2010 10:03 > To: imt...@li... > Subject: [Imtoolkit-users] IM C++ bindings to Lua > > Hello, > > I am writing a C++ program to display some image processed videos. My > program has some basic image processing functions available through IM, > but I'd like to extend it thanks to Lua/imLua. > IM is working in C++ and Lua, so I'd like to expose my imImage instance > in C++ to Lua, make some treatments, and then go back to C++ to display > it. > Do you think it's possible? (I already know how to do bindings thanks > to Luabind) > Will the data buffer contained in the C++ part of the imImage instance > be copied to the Lua world, or will C++ and Lua (imLua) share the same > memory zone? > What CPU and memory will it cost compared to C++ only image processing > with imLua? > > Thanks in advance, > Chris. > # > " Ce courriel et les documents qui lui sont joints peuvent contenir des > informations confidentielles ou ayant un caractère privé. S'ils ne vous > sont > pas destinés, nous vous signalons qu'il est strictement interdit de les > divulguer, de les reproduire ou d'en utiliser de quelque manière que ce > soit le contenu. Si ce message vous a été transmis par erreur, merci > d'en > informer l'expéditeur et de supprimer immédiatement de votre système > informatique ce courriel ainsi que tous les documents qui y sont > attachés." > ****** > " This e-mail and any attached documents may contain confidential or > proprietary information. If you are not the intended recipient, you are > notified that any dissemination, copying of this e-mail and any > attachments > thereto or use of their contents by any means whatsoever is strictly > prohibited. If you have received this e-mail in error, please advise > the > sender immediately and delete this e-mail and all attached documents > from your computer system." > # > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Imtoolkit-users mailing list Imt...@li... https://lists.sourceforge.net/lists/listinfo/imtoolkit-users # " Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles ou ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés." ****** " This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system." # |
From: Antonio S. <sc...@te...> - 2010-07-22 16:51:37
|
Hi Chris, ImLua already expose the imImage structure to Lua. Are you saying that you created a class that inherit from the imImage structure in C++ to extend it? Anyway, in ImLua the image data is still stored in C/C++, it is not duplicated in Lua. If you create algorithms in Lua by combining IM functions then the cost is very low. But to implement the algorithm in Lua accessing image pixels it will be very slow. Best Regards, Antonio Scuri > -----Original Message----- > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > [mailto:chr...@sa...] > Sent: quinta-feira, 22 de julho de 2010 10:03 > To: imt...@li... > Subject: [Imtoolkit-users] IM C++ bindings to Lua > > Hello, > > I am writing a C++ program to display some image processed videos. My > program has some basic image processing functions available through IM, > but I'd like to extend it thanks to Lua/imLua. > IM is working in C++ and Lua, so I'd like to expose my imImage instance > in C++ to Lua, make some treatments, and then go back to C++ to display > it. > Do you think it's possible? (I already know how to do bindings thanks > to Luabind) > Will the data buffer contained in the C++ part of the imImage instance > be copied to the Lua world, or will C++ and Lua (imLua) share the same > memory zone? > What CPU and memory will it cost compared to C++ only image processing > with imLua? > > Thanks in advance, > Chris. > # > " Ce courriel et les documents qui lui sont joints peuvent contenir des > informations confidentielles ou ayant un caractère privé. S'ils ne vous > sont > pas destinés, nous vous signalons qu'il est strictement interdit de les > divulguer, de les reproduire ou d'en utiliser de quelque manière que ce > soit le contenu. Si ce message vous a été transmis par erreur, merci > d'en > informer l'expéditeur et de supprimer immédiatement de votre système > informatique ce courriel ainsi que tous les documents qui y sont > attachés." > ****** > " This e-mail and any attached documents may contain confidential or > proprietary information. If you are not the intended recipient, you are > notified that any dissemination, copying of this e-mail and any > attachments > thereto or use of their contents by any means whatsoever is strictly > prohibited. If you have received this e-mail in error, please advise > the > sender immediately and delete this e-mail and all attached documents > from your computer system." > # > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users |
From: DONGIEUX-AKKA C. (S. D. SECURITE)
<chr...@sa...> - 2010-07-22 13:03:57
|
Hello, I am writing a C++ program to display some image processed videos. My program has some basic image processing functions available through IM, but I'd like to extend it thanks to Lua/imLua. IM is working in C++ and Lua, so I'd like to expose my imImage instance in C++ to Lua, make some treatments, and then go back to C++ to display it. Do you think it's possible? (I already know how to do bindings thanks to Luabind) Will the data buffer contained in the C++ part of the imImage instance be copied to the Lua world, or will C++ and Lua (imLua) share the same memory zone? What CPU and memory will it cost compared to C++ only image processing with imLua? Thanks in advance, Chris. # " Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles ou ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés." ****** " This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system." # |
From: Antonio S. <sc...@te...> - 2010-06-24 13:43:23
|
The 3.6.2 version of the IM toolkit has been released. You can find the list of changes and files for download at: http://www.tecgraf.puc-rio.br/im/ Best Regards, Antonio Scuri |
From: phool p. <pho...@gm...> - 2010-06-01 05:18:33
|
hi all... sorry to bother u. it is in concern with my previous post regarding reading RGB plane separately. everything is fine. i was missing imColorModeIsTopDown Flag. code i posted is working just fine. i am using NewMat Matrix library. |
From: Antonio S. <sc...@te...> - 2010-05-31 18:14:10
|
"depth" is the number of planes the image has, GRAY images have depth=1, RGB depth=3, RGB with alpha depth=4. The function imColorModeDepth will compute the depth from the color_mode for you. "d" is the current plane you are processing, similar to x and y. The code you sent, seems to be correct, considering the function r_matrix(m, n) does the necessary type convertion. What's the result? BTW, if you are using C++ the processing of several data types is easier if you use templates. Inside the IM source code you will see several functions using templates internally. Even though their API is in C. BTW2, I noticed that you are storing separated planes (not packed). You can configure imFileReadImageData to load unpacked data even if the data in the file is packed. Best, scuri From: phool preet [mailto:pho...@gm...] Sent: segunda-feira, 31 de maio de 2010 02:38 To: imt...@li... Subject: Re: [Imtoolkit-users] segmentation fault by inFileReadImageData hello all... these are some lines from online user guide...... ---------------------------------------------------------------------------- --------------------------------------------------------------------------- To create a raw image buffer you can simply use the utility function: int width, height, color_mode, data_type; int size = imImageDataSize(width, height, color_mode, data_type); void* buffer = malloc(size); So if the data type is IM_FLOAT, we could write: float* idata = (float*)buffer; Then to locate the pixel at line y, column x, component d simply write: float value; if (is_packed) value = idata[y*width*depth + x*depth + d] else value = idata[d*width*height + y*width + x] ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- what are the parameters d and depth are? i am trying to read RGB values from image data. i have written a code but that doesn't seems to be working..... if (imColorModeSpace(color_mode) == IM_RGB && imColorModeIsPacked(color_mode)) { switch (data_type) { case IM_BYTE : { std::cout << "IM_BYTE\n"; unsigned char *ptr_to_uchar = (unsigned char *)data; for (int m = 1; m <= height; m++) { for (int n = 1; n <= width; n++) { r_matrix(m, n) = *ptr_to_uchar++; g_matrix(m, n) = *ptr_to_uchar++; b_matrix(m, n) = *ptr_to_uchar++; } } break; } case IM_USHORT : { std::cout << "IM_USHORT\n"; unsigned short *ptr_to_ushort = (unsigned short *)data; for (int m = 1; m <= height; m++) { for (int n = 1; n <= width; n++) { //std::cout << m << " " << n << '\n'; r_matrix(m, n) = *ptr_to_ushort++; g_matrix(m, n) = *ptr_to_ushort++; b_matrix(m, n) = *ptr_to_ushort++; } } break; } case IM_INT : { std::cout << "IM_INT\n"; int *ptr_to_int = (int *)data; for (int m = 1; m <= height; m++) { for (int n = 1; n <= width; n++) { //std::cout << m << " " << n << '\n'; r_matrix(m, n) = *ptr_to_int++; g_matrix(m, n) = *ptr_to_int++; b_matrix(m, n) = *ptr_to_int++; } } break; } case IM_FLOAT : { std::cout << "IM_FLOAT\n"; float *ptr_to_float = (float *)data; for (int m = 1; m <= height; m++) { for (int n = 1; n <= width; n++) { //std::cout << m << " " << n << '\n'; r_matrix(m, n) = *ptr_to_float++; g_matrix(m, n) = *ptr_to_float++; b_matrix(m, n) = *ptr_to_float++; } } break; } default : std::cout << "Unrecognized or unsupported Data Type\n"; break; } can anybody tell what i am missing? |
From: phool p. <pho...@gm...> - 2010-05-31 05:38:38
|
hello all... > these are some lines from online user guide...... ------------------------------------------------------------------------------------------------------------------------------------------------------- To create a raw image buffer you can simply use the utility function: int width, height, color_mode, data_type; int size = imImageDataSize(width, height, color_mode, data_type); void* buffer = malloc(size); So if the data type is *IM_FLOAT*, we could write: float* idata = (float*)buffer; Then to locate the pixel at line y, column x, component d simply write: float value; if (is_packed) value = idata[y*width*depth + x*depth + d] else value = idata[d*width*height + y*width + x] ---------------------------------------------------------------------------------------------------------------------------------------------------------- what are the parameters d and depth are? i am trying to read RGB values from image data. i have written a code but that doesn't seems to be working..... if (imColorModeSpace(color_mode) == IM_RGB && imColorModeIsPacked(color_mode)) { switch (data_type) { case IM_BYTE : { std::cout << "IM_BYTE\n"; unsigned char *ptr_to_uchar = (unsigned char *)data; for (int m = 1; m <= height; m++) { for (int n = 1; n <= width; n++) { r_matrix(m, n) = *ptr_to_uchar++; g_matrix(m, n) = *ptr_to_uchar++; b_matrix(m, n) = *ptr_to_uchar++; } } break; } case IM_USHORT : { std::cout << "IM_USHORT\n"; unsigned short *ptr_to_ushort = (unsigned short *)data; for (int m = 1; m <= height; m++) { for (int n = 1; n <= width; n++) { //std::cout << m << " " << n << '\n'; r_matrix(m, n) = *ptr_to_ushort++; g_matrix(m, n) = *ptr_to_ushort++; b_matrix(m, n) = *ptr_to_ushort++; } } break; } case IM_INT : { std::cout << "IM_INT\n"; int *ptr_to_int = (int *)data; for (int m = 1; m <= height; m++) { for (int n = 1; n <= width; n++) { //std::cout << m << " " << n << '\n'; r_matrix(m, n) = *ptr_to_int++; g_matrix(m, n) = *ptr_to_int++; b_matrix(m, n) = *ptr_to_int++; } } break; } case IM_FLOAT : { std::cout << "IM_FLOAT\n"; float *ptr_to_float = (float *)data; for (int m = 1; m <= height; m++) { for (int n = 1; n <= width; n++) { //std::cout << m << " " << n << '\n'; r_matrix(m, n) = *ptr_to_float++; g_matrix(m, n) = *ptr_to_float++; b_matrix(m, n) = *ptr_to_float++; } } break; } default : std::cout << "Unrecognized or unsupported Data Type\n"; break; } can anybody tell what i am missing? |
From: Antonio S. <sc...@te...> - 2010-05-27 17:12:26
|
Hi, Your message did not get posted in the list because of the attachment. But they are very small, something is not right. I'll check this. About your problem, the data pointer must be allocated by the application. It will not be allocated by IM. So before imFileReadImageData, you can do: int size = imImageDataSize(width, height, color_mode, data_type); data = new unsigned char[size]; And at the end you should do: delete data; Best, Scuri From: phool preet [mailto:pho...@gm...] Sent: quinta-feira, 27 de maio de 2010 11:01 To: imt...@li... Subject: segmentation fault by inFileReadImageData hi.. i have installed im 3.6.1 on opensuse 11.0. i tried to run a simple program but got segmentation fault. it appears that function imFileReadImageData(image, data, 0, -1); is causing this because when u comment this function program just run fine. i tried to run a debugger gdb. i am attaching main program and a snapshot. i don't know what to do from here. any help will be appreciated |
From: Antonio S. <sc...@te...> - 2010-04-23 20:03:18
|
Hi All, The 3.6.1 version of the IM toolkit has been released. This is just a bug fix. You can find the list of changes and files for download at: http://www.tecgraf.puc-rio.br/im/ Best Regards, Antonio Scuri |
From: Antonio S. <sc...@te...> - 2010-03-15 19:56:31
|
Yes, that was a bug. Thanks! scuri > -----Original Message----- > From: regmail1983 regmail [mailto:reg...@ma...] > Sent: segunda-feira, 15 de março de 2010 16:24 > To: imt...@li... > Subject: [Imtoolkit-users] BUG in IM 3.6 > > HI! > > I have found bug in IM 3.6 > > file :imlua_process.c, line 1712 > > > /********************************************************************** > *******\ > im.ProcessCompose > \********************************************************************** > *******/ > static int imluaProcessCompose(lua_State *L) > { > imImage *src_image1 = imlua_checkimage(L, 1); > imImage *src_image2 = imlua_checkimage(L, 2); > imImage *dst_image = imlua_checkimage(L, 4); <--BUG HERE, SHOULD BE > 3 > > imlua_match(L, src_image1, src_image2); > imlua_match(L, src_image1, dst_image); > > imProcessCompose(src_image1, src_image2, dst_image); > return 0; > } > > > > ----------------------------------------------------------------------- > ------- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users |
From: regmail1983 r. <reg...@ma...> - 2010-03-15 19:24:15
|
HI! I have found bug in IM 3.6 file :imlua_process.c, line 1712 /*****************************************************************************\ im.ProcessCompose \*****************************************************************************/ static int imluaProcessCompose(lua_State *L) { imImage *src_image1 = imlua_checkimage(L, 1); imImage *src_image2 = imlua_checkimage(L, 2); imImage *dst_image = imlua_checkimage(L, 4); <--BUG HERE, SHOULD BE 3 imlua_match(L, src_image1, src_image2); imlua_match(L, src_image1, dst_image); imProcessCompose(src_image1, src_image2, dst_image); return 0; } |
From: Antonio S. <sc...@te...> - 2010-01-27 05:39:41
|
The 3.6 version of the IM toolkit has been released. IM is a toolkit for Digital Imaging. IM is based on 4 concepts: Image Representation, Storage, Processing and Capture. You can find the list of changes and files for download at: http://www.tecgraf.puc-rio.br/im/ Best Regards, Antonio Scuri |
From: Antonio S. <sc...@te...> - 2009-10-01 20:04:31
|
The 3.5 version of the IM toolkit has been released. IM is a toolkit for Digital Imaging. IM is based on 4 concepts: Image Representation, Storage, Processing and Capture. You can find the list of changes and files for download at: http://www.tecgraf.puc-rio.br/im/ Best Regards, Antonio Scuri |
From: Antonio S. <sc...@te...> - 2009-06-27 05:38:53
|
Hi, The 3.4.2 version of the IM toolkit has been released. IM is a toolkit for Digital Imaging. IM is based on 4 concepts: Image Representation, Storage, Processing and Capture. You can find the list of changes and files for download at: http://www.tecgraf.puc-rio.br/im/ This is just a bug fix release. We would like to thank everyone that send us feedback so this release was possible. Best Regards, Antonio Scuri |
From: Antonio S. <sc...@te...> - 2008-12-17 05:16:52
|
Hi, The 3.4.1 version of the IM toolkit has been released. IM is a toolkit for Digital Imaging. IM is based on 4 concepts: Image Representation, Storage, Processing and Capture. You can find the list of changes and files for download at: http://www.tecgraf.puc-rio.br/im/ This is just a bug fix release. We would like to thank everyone that send us feedback so this release was possible. Best Regards, Antonio Scuri |