Since yesterday i am using EmguCV together with XNA. I have some experiences with OpenCV and C++. This is my first post here.
Want i want to do is getting a frame from a webcam and putting it onto a XNA texture. Here is the source:
Code: Select all
public bool CreateCamera()
capture = new Capture();
if (capture != null)
public void QueryFrame(Texture2D texture)
// get frame and copy data to texture
Image<Bgr, Byte> image = capture.QueryFrame();
if (image != null)
My program always crashes in the line "texture.SetData(image.Bytes);"
What do i wrong? Or has anyone an example code for me?