Using Kinect with Emgu CV

With EmguCV, to capture an image from a web-cam we use :

Capture cap = new Capture(0);

Image < Bgr, byte > nextFrame = cap.QueryFrame();

...

...

But I don’t know how to capture images from my Kinect, I have tried kinectCapture class but it didn’t work with me. Thanks

Trouble using Kinect ColorImageFrame with Emgu CV

I’m working on a project for school involving C#, Kinect, and Emgu CV. I fairly new to both C# and Emgu CV, so I may be missing something simple. What I am trying to do is use the image from the Kinec

Background subtraction using Emgu CV

How can I implement background subtraction using Emgu CV?



Emgu CV and the official Microsoft Kinect SDK?

Emgu CV currently allows the use of the Kinect with the OpenNI drivers. I’ve also seen that there exists an mssdk-openni bridge application to allow the Kinects running on the official Microsoft SDK

Harris corner using Emgu CV

Im trying to apply Harris corners using Emgu CV Wrapper, and I’m learning from a book titled Open CV 2, Computer Vision Application Cook Book , the book examples are based on C++, below is their exa

Convert codec using Emgu CV

I’m using Emgu CV to extract frame from video file in C#. When I try to create a new Capture instance with file name, I get an error, probably because this file codec is unknown for Emgu CV. How can I

Track IR Led using EMGU CV?

I have been trying to make head mounted (Infrared)IR Led light tracker using EMGU CV? I know head tracking using EMGU CV. But head mounted IR Led light tracker gives more accuracy. I want make some th

Video Player using Emgu CV

I want to make a video player with detection of objects using Emgu CV. I’d like to start with reading from a video source file and that is where I got an error. In line: Capture capture = new Capture(

Motion tracking using Emgu CV (or OpenCV)

How can I do motion tracking using Emgu CV or OpenCV? What are different ways of doing it? I want to track objects against a fixed background. Best Regards

Converting contours found using EMGU.CV

I am new to EMGU.CV and I am struggling a bit. Let me start by giving some background of the project, i am trying to track a users fingers, i.e. calculate the users finger tips, but i am struggling a

How to get video stream from webcam in emgu cv?

I’m using emgu cv in c#. I need to know How I can get the video stream from my webcam(default webcam)in emgu cv?

Answers

When using EmguCV, you usually use another library to access the Kinect. For example, The Kinect For Windows SDK, or OpenNI. Then after accessing the camera using OpenNI or the SDK, you can edit the image that you project on the screen using EmguCV’s tools. Here’s some links of how to use EmguCV with OpenNI and the SDK

Hope this helps!

Basically , you need to capture and Image from the ColorStream and convert to a EmguCV Image class :

Conversion to EmguCV Image from Windows BitMap (Kinect ColorStream):

You have a Windows Bitmap variable, where holds Kinect Frame.

Bitmap bmap = new Bitmap(weightFrame,HeightFrame,System.Drawing.Imaging.PixelFormat.Format32bppRgb);

...

//Here is the code where you capture the image in the ColorFrameReady....

...

Image<Bgr,Byte> frameActualKinect = bmap.ToOpenCVImage<Bgr, Byte>();

Make the detection:

Resize

currentFrame = frameActualKinect.Resize(320, 240, Emgu.CV.CvEnum.INTER.CV_INTER_CUBIC);

//Convert it to Grayscale

gray = currentFrame.Convert<Gray, Byte>();

//Face Detector

MCvAvgComp[][] facesDetected = gray.DetectHaarCascade(face, 1.2, 10, Emgu.CV.CvEnum.HAAR_DETECTION_TYPE.DO_CANNY_PRUNING,new System.Drawing.Size(20, 20));

P.D (The helper method) :

public static Image<TColor, TDepth> ToOpenCVImage<TColor, TDepth>(this Bitmap bitmap)
        where TColor : struct, IColor
        where TDepth : new()
    {
        return new Image<TColor, TDepth>(bitmap);
    }