[WIP] Webcam Plugin

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
Posts: 15
Joined: Thu Feb 03, 2011 8:17 pm
Location: Campinas, SP Brasil

Re: [WIP] Webcam Plugin

Postby thejesusbr » Fri Aug 26, 2011 8:44 pm

I depared with the same problem, so I wrote a entire new implementation using OpenCV. It is not difficult to try your own. I am finishing my master degree dissertation, so I don't have time to make a plugin, but I can give you the class that I developed. You have to solve the dependencies on your own, but with my code you will have a starting point. I also implement it with pthreads, so the rendering loop will not be limited by the frame rate of the cam. It needs a more elegant implementation of frame buffers, but it fits my needs right now. The code was developed with Ogre 1.7.2, so you may have to adaptate it in order to run with your version. The comments are in portuguese and you will need pthreads and OpenCV >= 2.2, but with these two libraries it can be done. As a bonus, I am working with Kinect and since the OpenCV has support for it, you can use it too! To use the library, simply include the codes and instantiate the VideoManager class. It renders the video source to a dynamic texture associated with it. You must call the update method to renew the texture each frame. There are a trigger that signal the arrive of a new frame, preventing crossed accessess to the texture.
Video Manager for Ogre. Tested with 1.7.2 version.
(3.2 KiB) Downloaded 93 times
0 x

Posts: 1
Joined: Mon Aug 29, 2011 9:42 am

Re: windows7 problems with Webcam Plugin

Postby mars_wei » Mon Aug 29, 2011 10:18 am

In windows7 use WebcamPlugin.
WebcamPlugin plug in the phrase code mCvCapture = cvCreateCameraCapture (0);.
cvCreateCameraCapture (0) returns an empty value, no significant visual images. looking for a long time could not find the problem.
help me. Thank you
0 x

Posts: 1
Joined: Wed Feb 13, 2013 1:17 pm

Re: [WIP] Webcam Plugin

Postby Muxi21 » Wed Feb 13, 2013 1:19 pm

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.


No problem :)

You can try to set plugin.expose_full_path to true in about:config and then enter about:plugins in the location (address) bar to check the path and versions being used/detected. Hopefully this would provide some insight.

0 x

Return to “Using OGRE in practice”

Who is online

Users browsing this forum: No registered users and 1 guest