[WIP] Webcam Plugin

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.

Postby ShadeOgre » Thu May 29, 2008 2:57 pm

OgreSDK/Samples/Common/include (if you compile the source manually), but I think, if you use the precompiled SDK it's in the same dir (but im not sure). Anyway, this is in one of the ogreSDK's subdir, so search for it ;)
ShadeOgre
Gremlin
 
Posts: 158
Kudos: 0
Joined: 10 Mar 2008
Location: Budapest, Hungary

Postby westpointer » Wed Oct 22, 2008 2:39 pm

what the webcam is used for?
I downloaded Demo_Bin_WebcamPlugin, but have no idea how to use it, or how to make it works.
User avatar
westpointer
Halfling
 
Posts: 62
Kudos: 0
Joined: 23 May 2008

Postby outdoors » Wed Nov 12, 2008 3:01 pm

hi,

i'm trying to compile the source code with ming+ codeblocks but i get this error:

undefined reference to _imp___ZN4Ogre16WebcamController30getWebcamTextureByMaterialNameERKSs'

Someone knows what is this?

Thank you!
outdoors
Gnoblar
 
Posts: 2
Kudos: 0
Joined: 12 Nov 2008

Missing Plugin_Webcam.lib

Postby crownin110 » Tue Nov 18, 2008 12:46 am

I've been attempting to use the webcam plugin for OGRE but I can't seem to find the Plugin_Webcam.lib. I tried compiling the source for the project in hopes that it would create the missing library, but I haven't been able to compile that because of an error I have been receiving. The error is located in the OgreExport ExternalTextureSourceManager.h line 51 and reads "error C2504: 'ResourceAlloc' : base class undefined. If anyone could either send me a link to the Plugin_Webcam.lib or maybe help me out with the error that would be really appreciated.
crownin110
Gnoblar
 
Posts: 1
Kudos: 0
Joined: 14 Nov 2008

Re: [WIP] Webcam Plugin

Postby DrScorpion » Mon Jun 29, 2009 5:12 pm

Hi all,

I have compiled the plugin in VS2005 - so that it refers to header files from Mogre and loaded it in a Mogre project.

1. When I add the plugin in the plugins.cfg - and launch the application, it crashes. I assume perhaps it's due to some references that the Plugin_Webcam.dll is making. From the log I get the following

17:26:12: Loading library .\Plugin_Webcam
17:26:12: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library .\Plugin_Webcam. System Error: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. in DynLib::load at ..\src\OgreDynLib.cpp (line 80)


2. Assuming that this is resolved, how would I access the classes defined in the plugin?

For example, WebCamController object is required.
ExternalTextureSourceManager.Singleton.SetCurrentPlugIn("webcam_video");
WebCamController webcamc = (WebCamController)ExternalTextureSourceManager.Singleton.CurrentPlugin;

Translated from Demo
ExternalTextureSourceManager::getSingleton().setCurrentPlugIn("webcam_video");
WebcamController* WebcamCtrl = (WebcamController*)ExternalTextureSourceManager::getSingleton().getCurrentPlugIn();

Thanks a lot ;-)
DrScorpion
Gnoblar
 
Posts: 1
Kudos: 0
Joined: 29 Jun 2009

Re: [WIP] Webcam Plugin

Postby magichere » Fri Aug 14, 2009 1:44 am

I found out that The webcam plugin dosen`t work with the latest OGRE 1.6.3 , It`s work 1.4.9 .
magichere
Gnoblar
 
Posts: 2
Kudos: 0
Joined: 03 Dec 2008

Just switched to Ogre

Postby Incepcionizta » Fri Apr 16, 2010 5:55 am

Hi guys! :D Any updates on the plugin yet? Tnx! :D
Incepcionizta
Gnoblar
 
Posts: 1
Kudos: 0
Joined: 16 Apr 2010

Re: [WIP] Webcam Plugin

Postby Shago » Thu May 13, 2010 8:05 pm

I managed to make it work on Visual Studio 2008 with Ogre 1.7.1, Open CV 2.1 and PTypes 2.1.1 without much hazzle.
Great plugin.
Shago
Gnoblar
 
Posts: 2
Kudos: 0
Joined: 13 May 2010

Re: [WIP] Webcam Plugin

Postby bwillers » Wed Jul 14, 2010 7:48 am

I'm trying to get this to build on VStudio 2010 but I keep getting bizarre errors seemingly coming from the standard libraries:

Code: Select all
1>  Webcam.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\complex(42): error C2039: '_C_double_complex' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\complex(42): error C2146: syntax error : missing ';' before identifier '_Dcomplex_value'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\complex(42): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...


Anyone have any ideas on how to fix this?

Thanks
bwillers
Kobold
 
Posts: 37
Kudos: 0
Joined: 26 Oct 2009

Re: [WIP] Webcam Plugin

Postby Wolf » Fri Oct 01, 2010 10:49 am

I know this post is pretty old but if that can help someone :

CV:: seems to be releated to some complexvalue class or functions as written in the error messages. To compile you need to remove all the CV:: of the solution and of course remove the namespace CV { } in Webcam.h (just keep the includes outside of any namespace).

Haven't tested the lib yet but at least it compiles without any error.
Wolf
Kobold
 
Posts: 28
Kudos: 0
Joined: 14 Jan 2005
Location: Switzerland

Re: [WIP] Webcam Plugin

Postby aldofk » Thu Nov 18, 2010 3:46 pm

hi,
I'm a new developer.
I have downloaded the WebcamPluginDemo and managed to make it compile and run (under Linux kubuntu lucid).
the problem is:
the image from the webcam is just a blurred, uniform color, however the color changes if you show something else to the camera.
the Ogre head is visible, and textured with the same uniform color coming from the webcam.
the webcam itself is perfectly working with other sw such as cheese or vlc.

did anyone experienced anything similar?
what could be the reason for this behaviour?
thanks
a.
aldofk
Gnoblar
 
Posts: 4
Kudos: 0
Joined: 18 Nov 2010

Re: [WIP] Webcam Plugin

Postby so0os » Thu Nov 18, 2010 4:06 pm

aldofk wrote:hi,
I'm a new developer.
I have downloaded the WebcamPluginDemo and managed to make it compile and run (under Linux kubuntu lucid).
the problem is:
the image from the webcam is just a blurred, uniform color, however the color changes if you show something else to the camera.
the Ogre head is visible, and textured with the same uniform color coming from the webcam.
the webcam itself is perfectly working with other sw such as cheese or vlc.

did anyone experienced anything similar?
what could be the reason for this behaviour?
thanks
a.


Check your texture coords.
Sos Sosowski :)
http://www.sos.gd
User avatar
so0os
Bugbear
 
Posts: 833
Kudos: 33
Joined: 15 Apr 2010
Location: Poznan, Poland

Re: [WIP] Webcam Plugin

Postby aldofk » Thu Nov 18, 2010 4:06 pm

I will, thank you
aldofk
Gnoblar
 
Posts: 4
Kudos: 0
Joined: 18 Nov 2010

Re: [WIP] Webcam Plugin

Postby aldofk » Thu Nov 18, 2010 9:47 pm

that was exactly what you suggested.
thank you a lot!
aldofk
Gnoblar
 
Posts: 4
Kudos: 0
Joined: 18 Nov 2010

Re: [WIP] Webcam Plugin

Postby galomar » Wed Jan 19, 2011 12:11 pm

Wolf wrote:I know this post is pretty old but if that can help someone :

CV:: seems to be releated to some complexvalue class or functions as written in the error messages. To compile you need to remove all the CV:: of the solution and of course remove the namespace CV { } in Webcam.h (just keep the includes outside of any namespace).

Haven't tested the lib yet but at least it compiles without any error.


Hi!

I've got that problem and I solved it with Wolf's method. Now I can generate the WebcamPlugin project. But when I try to generate the WebcamPluginDemo I've got more problems (with file Webcam.h from WebcamPlugin project (?) ).

First of all, it can't found the pasync.h file (from PTypes_DLL project). I change the correspondent #import adding the relative path and it's solved.

Then, I have problems with de OpenCV source files (cxtypes.h, cxcore.h, cxcore.hpp, cxoperations.hpp) with "ambiguous symbols". A lot of errors like this:

>c:\opencv2.1\include\opencv\cxtypes.h(178) : error C2872: 'int64' : símbolo ambiguo puede ser 'c:\opencv2.1\include\opencv\cxtypes.h(146) : __int64 int64' o 'c:\ogresdk_vc9_v1-7-2\include\ogre\ogreplatform.h(255) : Ogre::int64'
>c:\opencv2.1\include\opencv\cxtypes.h(179) : error C2872: 'uint64' : símbolo ambiguo puede ser 'c:\opencv2.1\include\opencv\cxtypes.h(147) : unsigned __int64 uint64' o 'c:\ogresdk_vc9_v1-7-2\include\ogre\ogreplatform.h(254) : Ogre::uint64'
>c:\opencv2.1\include\opencv\cxtypes.h(307) : error C2872: 'uint64' : símbolo ambiguo puede ser 'c:\opencv2.1\include\opencv\cxtypes.h(147) : unsigned __int64 uint64' o 'c:\ogresdk_vc9_v1-7-2\include\ogre\ogreplatform.h(254) : Ogre::uint64'


It seems that the Ogre namespace from Webcam.h is "active" when try to compile the OpenCV lib and the compiler doesn't know wich symbol is the correct. I tried to use using namespace std; in these files but it doesn't work.

I'm using OgreSDK_vc10_v1-7-2, OpenCV 2.1 and Visual Studio 2010. I've tryed too with Visual Studio 2008 and his respective SDK.

Can anyone help me, please?

Thank you!

PS: I know that my english is very poor, I'm sorry about that!
galomar
Gnoblar
 
Posts: 2
Kudos: 0
Joined: 19 Jan 2011
Location: Spain

Re: [WIP] Webcam Plugin

Postby so0os » Wed Jan 19, 2011 12:22 pm

you need to write Ogre::uint64, OR do not use Ogre namespace;
Sos Sosowski :)
http://www.sos.gd
User avatar
so0os
Bugbear
 
Posts: 833
Kudos: 33
Joined: 15 Apr 2010
Location: Poznan, Poland

Re: [WIP] Webcam Plugin

Postby galomar » Wed Jan 19, 2011 1:52 pm

so0os wrote:you need to write Ogre::uint64, OR do not use Ogre namespace;


Thank you for your reply so0os.

I think that the types that need to be used are the defined on cxtypes.h from OpenCV lib. Then, I must "unuse" the Ogre namespace. But I don't understand why I can generate the WebcamPlugin project (that uses the OpenCV lib and Ogre lib, managing Ogre namespace, without any error) but when the WebcamPluginDemo use the plugin then I have these errors. I haven't modified the project (well, I have deleted only the namespace CV on Webcam.h from WebcamPlugin to avoid the same problem that bwillers and it works fine).

bwillers wrote:I'm trying to get this to build on VStudio 2010 but I keep getting bizarre errors seemingly coming from the standard libraries:

Code: Select all
1>  Webcam.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\complex(42): error C2039: '_C_double_complex' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\complex(42): error C2146: syntax error : missing ';' before identifier '_Dcomplex_value'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\complex(42): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...


Anyone have any ideas on how to fix this?

Thanks


so0os, do you can generate both projects?

I don't know how I must delete the Ogre namespace from the WebcamPlugin project. It's full of them. And when I do that, the errors become worst!
galomar
Gnoblar
 
Posts: 2
Kudos: 0
Joined: 19 Jan 2011
Location: Spain

Re: [WIP] Webcam Plugin

Postby so0os » Wed Jan 19, 2011 2:14 pm

I don't, I wrote my own webcam thingy. It's like 30 lines of code to get this working with just Ogre+OpenCV using dynamic textures. And just a few more if you want it threaded
Sos Sosowski :)
http://www.sos.gd
User avatar
so0os
Bugbear
 
Posts: 833
Kudos: 33
Joined: 15 Apr 2010
Location: Poznan, Poland

Re: [WIP] Webcam Plugin

Postby thejesusbr » Thu Feb 03, 2011 8:23 pm

Does anyone able to make the plugin work in linux? I even managed to compile and load, but the demo does not compile. Or does anyone have any other solution to have the webcam working? I intend to do a project with augmented reality.

Thanks!
User avatar
thejesusbr
Gnoblar
 
Posts: 15
Kudos: 0
Joined: 03 Feb 2011
Location: Campinas, SP Brasil

Re: [WIP] Webcam Plugin

Postby so0os » Fri Feb 04, 2011 12:18 am

thejesusbr wrote:Does anyone able to make the plugin work in linux? I even managed to compile and load, but the demo does not compile. Or does anyone have any other solution to have the webcam working? I intend to do a project with augmented reality.

Thanks!


It takes a framelistener and like 30 lines of code to do that yorself yousing dnamic textures and openCV
Sos Sosowski :)
http://www.sos.gd
User avatar
so0os
Bugbear
 
Posts: 833
Kudos: 33
Joined: 15 Apr 2010
Location: Poznan, Poland

Re: [WIP] Webcam Plugin

Postby thejesusbr » Fri Feb 04, 2011 12:44 am

so0os wrote:
thejesusbr wrote:Does anyone able to make the plugin work in linux? I even managed to compile and load, but the demo does not compile. Or does anyone have any other solution to have the webcam working? I intend to do a project with augmented reality.

Thanks!


It takes a framelistener and like 30 lines of code to do that yorself yousing dnamic textures and openCV


Ok... I'll do this. One more question: is possible to set a dynamic texture to the background (I'm a newbie in Ogre)?

I'll use ArtoolkitPlus to detect markers and give directions to the Ogre cameras (I can do this by now). I'm still thinking and rewrite some detection routines to work with CUDA. CUDA is able to access OpenGL buffers, so it will be give me the chance to process the texture in parallel.
User avatar
thejesusbr
Gnoblar
 
Posts: 15
Kudos: 0
Joined: 03 Feb 2011
Location: Campinas, SP Brasil

Re: [WIP] Webcam Plugin

Postby so0os » Fri Feb 04, 2011 9:08 am

Yeah, just make a ManualObject or rectangle2D with RenderQueue_1 or so and depth_write off. Also, I bet there's a background thingie in ogre.
Sos Sosowski :)
http://www.sos.gd
User avatar
so0os
Bugbear
 
Posts: 833
Kudos: 33
Joined: 15 Apr 2010
Location: Poznan, Poland

Re: [WIP] Webcam Plugin

Postby thejesusbr » Mon Feb 21, 2011 8:59 pm

Thanks, guys. I managed to easily integrate the OpenCV with a texture e show the camera image to the background. And using OpenCV with GStreamer, I am also able to use a USB, a FireWire or a network camera, just by changing one only parameter.

Now, I will be struggling with the ARToolKitPlus. The marker detection is running well, but the position vector that it gave to me is understimated... The movement of the virtual things are smaller than the movement of the marker... I don't know why... I'll question in other threads to find a fix for it.

The OpenCV solution was quite easy, so I'll not put any code here, but if anyone needs help, just contact me. But I don't think it will be necessary, it's quite easy.
User avatar
thejesusbr
Gnoblar
 
Posts: 15
Kudos: 0
Joined: 03 Feb 2011
Location: Campinas, SP Brasil

Re: [WIP] Webcam Plugin

Postby so0os » Tue Feb 22, 2011 8:52 am

Are you using both matrices (projection and view) from ARToolkit? Also, have you calibrated your camera correctly?
Sos Sosowski :)
http://www.sos.gd
User avatar
so0os
Bugbear
 
Posts: 833
Kudos: 33
Joined: 15 Apr 2010
Location: Poznan, Poland

Re: [WIP] Webcam Plugin

Postby thejesusbr » Tue Feb 22, 2011 2:18 pm

so0os wrote:Are you using both matrices (projection and view) from ARToolkit? Also, have you calibrated your camera correctly?


I calibrated the camera using the recomended Matlab toolbox. In that toolbox, the projection of camera is acurated. I'm using only the ModelView matrrix. How could I use both? By the way, the orientation quaternion is ok, only the position is given wrong. I will review the use of the matrices so.
User avatar
thejesusbr
Gnoblar
 
Posts: 15
Kudos: 0
Joined: 03 Feb 2011
Location: Campinas, SP Brasil

PreviousNext

Return to Using OGRE in practice

Who is online

Users browsing this forum: No registered users and 2 guests