public Configuration() { InitializeComponent(); floorPoints = new List<FloorPointControl>(); kinect = Kinect.Instance; //kinect.AverageWindowSize = 2; depthThreshold = new DepthThreshold(); rgbMask = new RGBMask(kinect.RGB, new System.Drawing.Rectangle(0, 0, kinect.DepthWidth, kinect.DepthHeight), kinect.RgbWidth); loadConfig(defaultConfigFileLocation); depthThreshold.AverageOldDepth = true; }
private void loadConfig(String path) { if (!File.Exists(path)) { MessageBox.Show("File doesn't exist! Cropping region and chopping plane are empty", path); choppingPlane = new ChoppingPlane(); croppingRegion = new System.Drawing.Rectangle(); return; } ConfigSettings loaded; using (FileStream fS = new FileStream(path, FileMode.Open)) { XmlSerializer serializer = new XmlSerializer(typeof(ConfigSettings)); loaded = (ConfigSettings)serializer.Deserialize(fS); } croppingRegion = loaded.InputRegion; choppingPlane = loaded.Plane; if (loaded.DThreshold != null) { depthThreshold = loaded.DThreshold; } ConnectedThreshold = loaded.ConnectedThreshold; RgbThreshold = loaded.RgbThreshold; ChopLow = loaded.ChopLow; ChopHigh = loaded.ChopHigh; updateSettingsView(); }