示例#1
0
    static void Main()
    {
        try
        {
            var zivid = new Zivid.NET.Application();

            Console.WriteLine("Setting up visualization");
            var visualizer = new Zivid.NET.CloudVisualizer();
            zivid.DefaultComputeDevice = visualizer.ComputeDevice;

            var Filename = "Zivid3D.zdf";
            Console.WriteLine("Reading " + Filename + " point cloud");
            var frame = new Zivid.NET.Frame(Filename);

            Console.WriteLine("Displaying the frame");
            visualizer.Show(frame);
            visualizer.ShowMaximized();
            visualizer.ResetToFit();

            Console.WriteLine("Running the visualizer. Blocking until the window closes");
            visualizer.Run();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
            Environment.ExitCode = 1;
        }
    }
    static void Main()
    {
        try
        {
            var zivid = new Zivid.NET.Application();

            Console.WriteLine("Setting up visualization");
            var visualizer = new Zivid.NET.CloudVisualizer();
            zivid.DefaultComputeDevice = visualizer.ComputeDevice;

            var zdfFile = Zivid.NET.Environment.DataPath + "/MiscObjects.zdf";

            Console.WriteLine("Initializing camera emulation using file: " + zdfFile);
            var camera = zivid.CreateFileCamera(zdfFile);

            Console.WriteLine("Capture a frame");
            var frame = camera.Capture();

            Console.WriteLine("Display the frame");
            visualizer.Show(frame);
            visualizer.ShowMaximized();
            visualizer.ResetToFit();

            Console.WriteLine("Run the visualizer. Block until window closes");
            visualizer.Run();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
            Environment.ExitCode = 1;
        }
    }
    static void Main()
    {
        try
        {
            var zivid = new Zivid.NET.Application();

            Console.WriteLine("Setting up visualization");
            var visualizer = new Zivid.NET.CloudVisualizer();
            zivid.DefaultComputeDevice = visualizer.ComputeDevice;

            Console.WriteLine("Connecting to camera");
            var camera = zivid.ConnectCamera();

            Console.WriteLine("Recording HDR source images");
            var frames = new List <Zivid.NET.Frame>();
            foreach (var iris in new ulong[] { 10, 25, 35 })
            {
                Console.WriteLine("Measure with iris = " + iris);
                camera.UpdateSettings(s =>
                {
                    s.Iris = iris;
                });
                frames.Add(camera.Capture());
            }

            Console.WriteLine("Creating HDR frame");
            var hdrFrame = Zivid.NET.HDR.CombineFrames(frames);

            Console.WriteLine("Display the frame");
            visualizer.ShowMaximized();
            visualizer.Show(hdrFrame);
            visualizer.ResetToFit();

            Console.WriteLine("Run the visualizer. Block until window closes");
            visualizer.Run();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
            Environment.ExitCode = 1;
        }
    }
示例#4
0
    static void Main()
    {
        try
        {
            var zivid = new Zivid.NET.Application();

            Console.WriteLine("Setting up visualization");
            var visualizer = new Zivid.NET.CloudVisualizer();
            zivid.DefaultComputeDevice = visualizer.ComputeDevice;

            Console.WriteLine("Connecting to camera");
            var camera = zivid.ConnectCamera();

            visualizer.ShowMaximized();

            Console.WriteLine("Starting live capturing of frames");
            var resetToFit = true;
            camera.SetFrameCallback(frame => {
                visualizer.Show(frame);
                if (resetToFit)
                {
                    visualizer.ResetToFit();
                    resetToFit = false;
                }
                frame.Dispose();
            });

            camera.StartLive();

            Console.WriteLine("Run the visualizer. Block until window closes");
            visualizer.Run();

            Console.WriteLine("Stopping live capturing");
            camera.StopLive();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
            Environment.ExitCode = 1;
        }
    }
    static void Main()
    {
        try
        {
            var zivid = new Zivid.NET.Application();

            Console.WriteLine("Setting up visualization");
            var visualizer = new Zivid.NET.CloudVisualizer();
            zivid.DefaultComputeDevice = visualizer.ComputeDevice;

            Console.WriteLine("Connecting to camera");
            var camera = zivid.ConnectCamera();

            Console.WriteLine("Adjusting the iris");
            camera.UpdateSettings(s =>
            {
                s.Iris = 22;
            });

            Console.WriteLine("Capture a frame");
            var frame = camera.Capture();

            Console.WriteLine("Display the frame");
            visualizer.Show(frame);
            visualizer.ShowMaximized();
            visualizer.ResetToFit();

            Console.WriteLine("Run the visualizer. Block until window closes");
            visualizer.Run();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
            Environment.ExitCode = 1;
        }
    }
    static void Main()
    {
        try
        {
            var zivid = new Zivid.NET.Application();

            Console.WriteLine("Setting up visualization");
            var visualizer = new Zivid.NET.CloudVisualizer();
            zivid.DefaultComputeDevice = visualizer.ComputeDevice;

            Console.WriteLine("Connecting to the camera");
            var camera = zivid.ConnectCamera();

            Console.WriteLine("Recording HDR source images");
            var frames = new List <Zivid.NET.Frame>();

            camera.UpdateSettings(s =>
            {
                s.Iris                       = 10;
                s.ExposureTime               = Duration.FromMicroseconds(10000);
                s.Brightness                 = 1;
                s.Gain                       = 1;
                s.Bidirectional              = false;
                s.Filters.Contrast.Enabled   = true;
                s.Filters.Contrast.Threshold = 5;
                s.Filters.Gaussian.Enabled   = true;
                s.Filters.Gaussian.Sigma     = 1.5;
                s.Filters.Outlier.Enabled    = true;
                s.Filters.Outlier.Threshold  = 5;
                s.Filters.Reflection.Enabled = true;
                s.Filters.Saturated.Enabled  = true;
                s.BlueBalance                = 1.081;
                s.RedBalance                 = 1.709;
            });

            ulong[] iris     = { 10, 20, 30 };
            long[]  exposure = { 10000, 20000, 30000 };

            for (int i = 0; i < 3; ++i)
            {
                camera.UpdateSettings(s =>
                {
                    s.Iris         = iris[i];
                    s.ExposureTime = Duration.FromMicroseconds(exposure[i]);
                });
                frames.Add(camera.Capture());
                Console.WriteLine("Frame " + (i + 1) + " " + camera.Settings.ToString());
            }

            Console.WriteLine("Creating the HDR frame");
            var hdrFrame = Zivid.NET.HDR.CombineFrames(frames);

            Console.WriteLine("Saving the frames");
            frames[0].Save("10.zdf");
            frames[1].Save("20.zdf");
            frames[2].Save("30.zdf");
            hdrFrame.Save("HDR.zdf");

            Console.WriteLine("Displaying the HDR frame");
            visualizer.ShowMaximized();
            visualizer.Show(hdrFrame);
            visualizer.ResetToFit();

            Console.WriteLine("Running the visualizer. Blocking until the window closes");
            visualizer.Run();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
            Environment.ExitCode = 1;
        }
    }