interact with a pc camera using c++ - c++

i intend to interact with a pc camera using c plus plus. Are there any libraries you can recommend or ways to go about ? The idea is to take shots with a Samsung wireless cam then get the images transferred unto a pc with cam and on the pc show images as per the face detection using the cam . any ideas where to start ?

Well, there's a wide range of ways to do it. Professional cameras have accompanying SDKs. If you camera is supported by it (I believe most webcams are) you should try OpenCV for a start.
Googling for "opencv face recognition" will yield plenty of hits, so you have a lot of reference material.
Try this reference (Face and Eyes Detection Using OpenCV) for a start.
After you start your project, you can specific questions on StackOverflow or on the OpenCV Yahoo! group.

Other options are:
1) openFrameworks.
Quoting from their website:
Openframeworks is a c++ library designed to assist the creative process by providing a simple and intuitive framework for experimentation.
The library is designed to work as a general purpose glue, and wraps together several commonly used libraries under a tidy interface: openGL for graphics, rtAudio for audio input and output, freeType for fonts,freeImage for image input and output, quicktime for video playing and sequence grabbing.
2) Qt
If you decide Qt, see this related question: Displaying WebCam video with Qt

Related

Kinect xbox 360

I am new on using a Kinect sensor, I have Kinect XBOX 360 and I need to use it to get a real moving body 3D positions. I need to use it with c++ and openCV. I could not find anything helpful on the web. So, please if anyone can give me some advice or if there any code for opening Kinect XBOX 360 with c++ to start with I will appreciate that.
Maybe try this library: https://github.com/OpenKinect/libfreenect . If you don't have to use C++ obviously the C# drivers for the xbox Kinect by Microsoft are quite useful.
You're going to want to use OpenNI (https://structure.io/openni) for this. It will make your life infinitely easier. I believe you can even compile OpenCV with OpenNI support out of the box.
You'll probably also want to download and compile PCL (http://pointclouds.org/), which will make managing and manipulating the 3D data a lot easier.
To build a cohesive 3D "world", you'll want to use a fusion library like KinectFusion, which is actually baked into PCL already (https://github.com/PointCloudLibrary/pcl/tree/master/gpu/kinfu).
For object recognition, you'll want to use a classifier, of which OpenCV and PCL have many.
There are a plethora of tutorials and examples using the Kinect as an RGBD source.

Opencv Vs FFmpeg performance comparision for web cam feed recording

I'm working on my academic project in which I've to record a video from the webcam.
In my google search, I've found that FFmpeg uses pipelining to record the video from the camera while OpenCV, AVbin use ctypes.
I don't know the pros and cons of either method, and wonder if you can help me decide which one to choose to write such kind of program in Linux.
I need to record 1024x768 30hz video and not experience latency/lag issues. Performance is the high priority.

How to distinguish OpenCV cameras?

I am writing C++ class for managing multiple cameras and reading frames from them. Let's say it is wrapper for OpenCV. Currently I am finding cameras by trying to create devices from 0-10 range and If there is output I know that I've found working camera. I can always save internal IDs of those cameras to distinguish them but what If another camera is plugged in? It may break the order of IDs. So is there any way to distinguish OpenCV cameras for example by getting their hardware IDs?
I know this doesn't help you much, but the short answer is "No, OpenCV doesn't currently provide that capability."
According to the doc, any hardware ids are not properties you can retrieve using the get method or any other.
Having said that, if you're very intent on using OpenCV, I would still test the behavior of OpenCV 2.4.10 on various platforms and using various middleware and see how it behaves. If you get a consistent behavior, then you can run with it, but be somewhat ready for it to break in the future. What would work for you is that OpenCV is using various middleware in the backend, such as V4L, Qt, etc., and these are well-maintained and more-or-less consistent.
In retrospect, I would stay away from OpenCV's video interface altogether right now for commercial software, unless you're okay with the situation I described. Beware that OpenCV 3.0 videoio library is unstable at this point and has open bug reports.

Microsoft Kinect - openNI Hand Generator issue

I am trying to use a kinect device in order to detect the palm within a kinect video(.oni video). I am using openNI libraries to develop this type of application.
They have published a manual of the basic features available within the openNI which can be seen here.
I have tried to implement the code which they displayed in the hand detection section, however, I don't have any results.
Do you happen to know where can I find a tutorial for a basic hand detection application for kinect through openNI library?
I started with OpenNI User Guide and it was very useful. There is a working example called "Working with Hand Point". If you want more powerful hand recognition you can try NITE. You can have working sample following this tutorial, it is for Linux, but most part of it will work even for Windows.
You can start with :
http://channel9.msdn.com/coding4fun/kinect/Simple-Hand-Tracking-with-MS-Kinect-SDK--WPF

Rendering Video in OpenGL

Is there a good solution for playing a compressed video in OpenGL?
It needs to
Be cross-platform (Windows and MacOSX)
Render to a texture (preferably but not 100% needed)
Cost less than Bink
Any ideas?
Qt can be used to render widgets (including a video player) in an OpenGL scene. It has a multimedia framework called phonon that can play video and audio.
See this demo video.
Qt is cross-platform and is now licensed under LGPL.
I recommend the Theora video format.
Here are the benefits:
Totally open, free and patent-unencoumbered specification
Free working library implementation (encoder/decoder) and source-code examples, available under a BSD-style license
Not too shabby documentation.
Portable
The decoder lets you decode to R'G'B', which can easily be uploaded with an OpenGL buffer object and fetched in a shader via a sampler.
if you mean by solution that you can build/code it, i can suggest quicktime (easy on mac with cocoa, strange on windows but it works) or you can checkout mplayer/vlc sources and try to integrate that. there are a lot of demos about this on the web.
since you need cross platform, i guess gstreamer, video4linux and directshow are nothing for you. but there are video players that support different backends on different platforms - like openFrameworks