using System; using System.Drawing; using MathNet.Numerics.LinearAlgebra.Single; using bbiwarg.DataSource; namespace bbiwarg.Test { class TestDataSource { static void Main(string[] args) { IVideoDataSource source = new IIsuDataSource("..\\..\\videos\\2.skv"); source.init(); source.start(); int i = 0; int j = 0; while (source.isActive()) { source.updateFrame(); if ((i % 30) == 0) { DataSource.DepthImage image = source.getDepthImage(); Bitmap bm = new Bitmap(image.getWidth(), image.getHeight()); for (int x = 0; x < image.getWidth(); ++x) { for (int y = 0; y < image.getHeight(); ++y) { int value = (int)(image.getDepth(x, y) / 1000.0 * 255.0) % 256; bm.SetPixel(x, y, Color.FromArgb(255, value, value, value)); } } Vector palmPosition2D = source.getPalmPosition2D(1); bm.SetPixel((int)palmPosition2D[0], (int)palmPosition2D[1], Color.Yellow); bm.Save("test." + j + ".png"); j++; } source.releaseFrame(); ++i; } source.stop(); } } }