Created
December 23, 2014 04:31
-
-
Save thomasweng15/9c498de6c772aee0930b to your computer and use it in GitHub Desktop.
Attempt at changing colorframes for the Kinect using openCV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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