Kinect检索图像的一部分

时间:2011-10-07 01:44:57

标签: c# wpf image kinect

  

可能重复:
  Kinect crop image

您好我是stackoverflow和kinect的新手。

我遇到了问题。如果有人能给我一个例子,那就太好了。

问题:我正在使用VideoFrameReady在RGBvideo图像控件中显示相机模式。此图像控件的高度为600,宽度为800.我想只检索该图像的一部分并将其显示在另一个图像控件上。我正在使用C#语言并在WPF中工作。

// This is my kinect VideoFrameReady method
void runtime_VideoFrameReady(object sender, 
                             Microsoft.Research.Kinect.Nui.ImageFrameReadyEventArgs e)
{
    PlanarImage image = e.ImageFrame.Image;

    BitmapSource source = BitmapSource.Create(image.Width, image.Height, 96, 96,
                                              PixelFormats.Bgr32, 
                                              null, image.Bits, 
                                              image.Width * image.BytesPerPixel);
    RGBvideo.Source = source; // RGBvideo is image control
} 
// example of the result I want. Retrieve the portion that are surrounded by a box/rectangle.

如果我的问题不明确,我很抱歉。我希望有人可以帮助我。

0 个答案:

没有答案