Skip to content

Instantly share code, notes, and snippets.

@thomasweng15
Created December 23, 2014 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasweng15/9c498de6c772aee0930b to your computer and use it in GitHub Desktop.
Save thomasweng15/9c498de6c772aee0930b to your computer and use it in GitHub Desktop.
Attempt at changing colorframes for the Kinect using openCV
//this.colorBuffer.Lock();
//colorFrame.CopyConvertedFrameDataToIntPtr(
// this.colorBuffer.BackBuffer,
// (uint)(colorFrameDescription.Width * colorFrameDescription.Height * 4),
// ColorImageFormat.Bgra);
//this.colorBuffer.AddDirtyRect(new Int32Rect(0, 0, this.colorBuffer.PixelWidth, this.colorBuffer.PixelHeight));
//this.colorBuffer.Unlock();
//IplImage iplOriginal = this.colorBuffer.ToIplImage();
//IplImage iplHsv = new IplImage(iplOriginal.Size, BitDepth.U8, 1);
//Cv.CvtColor(iplOriginal, iplHsv, ColorConversion.RgbaToGray);
//Cv.Threshold(iplHsv, iplHsv, 200, 255, ThresholdType.Binary);
//WriteableBitmap newBmp = iplHsv.ToWriteableBitmap();
//iplOriginal.Dispose();
//iplHsv.Dispose();
//newBmp.CopyPixels(
// Int32Rect.Empty,
// this.colorBitmap.BackBuffer,
// this.colorBitmap.PixelWidth * this.colorBitmap.PixelHeight * 4,
// this.colorBuffer.BackBufferStride);
//newBmp = null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment