[WIP] Webcam Plugin

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

Re: [WIP] Webcam Plugin

Post by thejesusbr »

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.
Attachments
VideoManager.zip
Video Manager for Ogre. Tested with 1.7.2 version.
(3.2 KiB) Downloaded 146 times
mars_wei
Gnoblar
Posts: 1
Joined: Mon Aug 29, 2011 9:42 am

Re: windows7 problems with Webcam Plugin

Post by mars_wei »

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
Muxi21
Gnoblar
Posts: 1
Joined: Wed Feb 13, 2013 1:17 pm

Re: [WIP] Webcam Plugin

Post by Muxi21 »

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!
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.

Thanks
Post Reply