Moderators: Moderators, OGRE Team


tuan kuranes
I understand OpenCV is the lib that take care of geting webcam Image and configuration, is it supposed to work out of the box on other platform ? did you tried it on macosx or gnu/linux?
tuan kuranes
Are threads mandatory for performance when getting image ?
tuan kuranes
Flipping Texture could be done using Texture Coordinates matrix, that would be indeed faster. (video plugin of pjcast does that, no ?)
tuan kuranes
btw, I can provide File hosting, if you want.
material <MaterialName>
{
technique
{
pass
{
texture_unit
{
texture_source webcam_video
{
//Flip true //flips around the y axis
//Webcam_Number 0 //Defines which webcam has to be use. (Could also be a TV-card. 0 is the standart device. > 0 are other devices. -1 is a random device)
}
}
}
}
}
My webcam only delivers 15 frames per second. So I had to use a thread which pulls the data stream from the webcam. The update method checks if there is a new frame available and it will updates the texture if necessary.
Would be nice

P.S.: Has anybody tried to compile the sources?
#include <WebcamController.h>
#include <WebcamPluginPreReqs.h>
copy $(OutDir)\$(TargetFileName) $(OGRE_HOME)\Bin\$(ConfigurationName); copy $(OutDir)\*.lib $(OGRE_HOME)\lib\opt\$(ConfigurationName);copy $(OutDir)\*.pdb $(OGRE_HOME)\lib\opt\$(ConfigurationName)copy $(OutDir)\$(TargetFileName) $(OGRE_HOME)\Bin\$(ConfigurationName); 
#include <WebcamController.h>
#include <WebcamPluginPreReqs.h>
I haven't noticed that OpenCV creates env vars. Ok, then can I set up the include pathes for OpenCV in the project settings.
Maybe I can provide two project solutions: One for the SDK user and one for the Ogre users which build Ogre from source?


#include <WebcamListener.h>
class TestWebcamListener : public WebcamListener
{
public:
TestWebcamListener();
void newFrame(Webcam* webcam);
virtual ~TestWebcamListener();
};
TestWebcamListener::TestWebcamListener()
{
}
void TestWebcamListener::newFrame(Webcam* webcam)
{
CV::IplImage* lImg = webcam->getCvImage();
//Do something with the image...
}
TestWebcamListener::~TestWebcamListener()
{
}
ExternalTextureSourceManager::getSingleton().setCurrentPlugIn("webcam_video");
WebcamController* WebcamCtrl = (WebcamController*)ExternalTextureSourceManager::getSingleton().getCurrentPlugIn();
testWebcamListener = new VisionControlledObjectManager::VisionControlledObjectWebcamListener(this);
WebcamCtrl->getWebcamByNumber(0)->addWebcamListerner(testWebcamListener);
WebcamCtrl->getWebcamByNumber(0)->removeWebcamListener(testWebcamListener);
delete testWebcamListener;
All webcams will be destroyed
Webcam 0 is shut down
Thread Cleaned
All webcam textures will be destroyed
Return to Using OGRE in practice
Users browsing this forum: jacmoe and 0 guests