public void CalculateNewSettingCalibratedResolution()
        {
            var target = new Point(160, 120);
            var objective = new Point(128, 120);
            var config = new CaptureConfig{Resolution = new Resolution(320, 240)};
            var strategy = new HandCalibratedModifierStrategy(config, target);

            strategy.Objective = objective;

            var setting = new PanTiltSetting(50,50);

            var newSetting = strategy.CalculateNewSetting(setting);

            // AssertBuilder.Generate(newSetting, "newSetting"); // The following assertions were generated on 07-Mar-2015
            #region CodeGen Assertions
            Assert.AreEqual(53.0720m, newSetting.PanPercent);
            Assert.AreEqual(50m, newSetting.TiltPercent);
            #endregion
        }
示例#2
0
        public static PiCameraConfig FromConfig(CaptureConfig config)
        {
            var s = new PiCameraConfig();

               if (config == null)
               {
               s.Width = 0;
               s.Height = 0;
               s.Bitrate = 0;
               s.Framerate = 0;
               s.Monochrome = 0;
               }
               else
               {
               s.Width = config.Resolution.Width;
               s.Height = config.Resolution.Height;
               s.Bitrate = config.Bitrate;
               s.Framerate = config.Framerate;
               s.Monochrome = config.Monochrome ? 1 : 0;
               }

               return s;
        }
示例#3
0
 public CaptureRequest()
 {
     Config = new CaptureConfig();
 }
示例#4
0
 ///<summary> Create a capture using the specific camera</summary>
 ///<param name="camIndex"> The index of the camera to create capture from, starting from 0</param>
 private CapturePi(int camIndex, CaptureConfig config)
 {
     _captureModuleType = CaptureModuleType.Camera;
     InitOpenCV();
     InitCapture(camIndex, PiCameraConfig.FromConfig(config));
 }
示例#5
0
 public CapturePi(CaptureConfig config)
     : this(0, config)
 {
 }