1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Drawing;
- namespace bbiwarg
- {
- class TestDataSource
- {
- static void Main(string[] args)
- {
- IVideoDataSource source = new IIsuDataSource("..\\..\\videos\\1.skv");
- source.init();
- source.start();
- int i = 0;
- int j = 0;
- while (source.isActive())
- {
- source.updateFrame();
- if ((i % 30) == 0)
- {
- 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 = (image.getDepth(x, y) / 4) % 256; // / 4 because most values are small (< 1024)
- bm.SetPixel(x, y, Color.FromArgb(255, value, value, value));
- }
- }
- bm.Save("test." + j + ".png");
- j++;
- }
- source.releaseFrame();
- ++i;
- }
- source.stop();
- }
- }
- }
|