static Zivid.NET.Frame AssistedCapture(Zivid.NET.Camera camera)
    {
        var suggestSettingsParameters = new Zivid.NET.CaptureAssistant.SuggestSettingsParameters
        {
            AmbientLightFrequency =
                Zivid.NET.CaptureAssistant.SuggestSettingsParameters.AmbientLightFrequencyOption.none,
            MaxCaptureTime = Duration.FromMilliseconds(800)
        };
        var settings = Zivid.NET.CaptureAssistant.Assistant.SuggestSettings(camera, suggestSettingsParameters);

        return(camera.Capture(settings));
    }
    static void Main()
    {
        try
        {
            var zivid = new Zivid.NET.Application();

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

            var suggestSettingsParameters = new Zivid.NET.CaptureAssistant.SuggestSettingsParameters
            {
                AmbientLightFrequency =
                    Zivid.NET.CaptureAssistant.SuggestSettingsParameters.AmbientLightFrequencyOption.none,
                MaxCaptureTime = Duration.FromMilliseconds(1200)
            };

            Console.WriteLine("Running Capture Assistant with parameters:\n{0}", suggestSettingsParameters);
            var settings = Zivid.NET.CaptureAssistant.Assistant.SuggestSettings(camera, suggestSettingsParameters);

            Console.WriteLine("Settings suggested by Capture Assistant:");
            Console.WriteLine(settings.Acquisitions);

            Console.WriteLine("Manually configuring processing settings (Capture Assistant only suggests acquisition settings)");
            settings.Processing.Filters.Reflection.Removal.Enabled = true;
            settings.Processing.Filters.Smoothing.Gaussian.Enabled = true;
            settings.Processing.Filters.Smoothing.Gaussian.Sigma   = 1.5;

            Console.WriteLine("Capturing frame");
            using (var frame = camera.Capture(settings))
            {
                string dataFile = "Frame.zdf";
                Console.WriteLine("Saving frame to file: " + dataFile);
                frame.Save(dataFile);
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
            Environment.ExitCode = 1;
        }
    }
示例#3
0
    static void Main()
    {
        try
        {
            var zivid = new Zivid.NET.Application();

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

            var suggestSettingsParameters = new Zivid.NET.CaptureAssistant.SuggestSettingsParameters(Duration.FromMilliseconds(1200), Zivid.NET.CaptureAssistant.AmbientLightFrequency.none);
            Console.WriteLine("Running Capture Assistant with parameters: {0}", suggestSettingsParameters);
            var settingsList = Zivid.NET.CaptureAssistant.SuggestSettings(camera, suggestSettingsParameters);

            Console.WriteLine("Suggested settings are:");
            foreach (var settings in settingsList)
            {
                Console.WriteLine(settings);
            }

            Console.WriteLine("Capture (and merge) frames using automatically suggested settings");
            var hdrFrame = Zivid.NET.HDR.Capture(camera, settingsList);

            string resultFile = "result.zdf";
            Console.WriteLine("Saving frame to file: " + resultFile);
            hdrFrame.Save(resultFile);
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error: " + ex.Message);
            Environment.ExitCode = 1;
        }
    }