public MainForm() { InitializeComponent(); if (!string.IsNullOrEmpty(Program.directory)) { this.Text += "-[" + Program.directory + "]"; } #if DEBUG diskSpaceCheckTimer.Interval = 1000 * 60; #endif config.GetLineCameras(); Properties.Settings setting = Properties.Settings.Default; cpuCounter = new PerformanceCounter(); ramCounter = new PerformanceCounter("Memory", "Available MBytes"); cpuCounter.CategoryName = "Processor"; cpuCounter.CounterName = "% Processor Time"; cpuCounter.InstanceName = "_Total"; //Camera[] cams = new Camera[Configuration.Instance.Cameras.Count]; //Configuration.Instance.Cameras.CopyTo(cams, 0); //this.Cameras = cams; time = new System.Windows.Forms.Timer(); time.Tick += time_Elapsed; time.Interval = 3000; time.Enabled = true; //FileHandle fh = new FileHandle();//删除无效视频 //fh.DeleteInvalidVideo(); //StartSetCam(setting);//根据光亮值设置相机 SetMonitor(); //启动布控 Program.motionDetector.SetRectThr(setting.Thresholding, setting.ImageArr); //调用分组设置值 InitStatusBar(); Program.motionDetector.DrawMotionRect = setting.DrawMotionRect; var faceSearchConfig = new FaceSearchWrapper.FaceSearchConfiguration(); faceSearchConfig.LeftRation = float.Parse(setting.IconLeftExtRatio); faceSearchConfig.TopRation = float.Parse(setting.IconTopExtRatio); faceSearchConfig.RightRation = float.Parse(setting.IconRightExtRatio); faceSearchConfig.BottomRation = float.Parse(setting.IconBottomExtRatio); faceSearchConfig.MinFaceWidth = int.Parse(setting.MinFaceWidth); int maxFaceWidth = int.Parse(setting.MaxFaceWidth); faceSearchConfig.FaceWidthRatio = (float)maxFaceWidth / faceSearchConfig.MinFaceWidth; faceSearchConfig.EnvironmentMode = setting.EnvMode; faceSearchConfig.SearchRectangle = new Rectangle(int.Parse(setting.SrchRegionLeft), int.Parse(setting.SrchRegionTop), int.Parse(setting.SrchRegionWidth), int.Parse(setting.SrchRegionHeight)); Program.faceSearch.Configuration = faceSearchConfig; }
public MainForm() { InitializeComponent(); if (!string.IsNullOrEmpty(Program.directory)) { this.Text += "-[" + Program.directory + "]"; } diskSpaceCheckTimer.Interval = Properties.Settings.Default.FreeDiskspaceCheckIntervalMs; config.GetLineCameras(); Properties.Settings setting = Properties.Settings.Default; cpuCounter = new PerformanceCounter(); ramCounter = new PerformanceCounter("Memory", "Available MBytes"); cpuCounter.CategoryName = "Processor"; cpuCounter.CounterName = "% Processor Time"; cpuCounter.InstanceName = "_Total"; //Camera[] cams = new Camera[Configuration.Instance.Cameras.Count]; //Configuration.Instance.Cameras.CopyTo(cams, 0); //this.Cameras = cams; time = new System.Windows.Forms.Timer(); time.Tick += time_Elapsed; time.Interval = 3000; time.Enabled = true; //FileHandle fh = new FileHandle();//删除无效视频 //fh.DeleteInvalidVideo(); //StartSetCam(setting);//根据光亮值设置相机 SetMonitor();//启动布控 Program.motionDetector.SetRectThr(setting.Thresholding, setting.ImageArr);//调用分组设置值 InitStatusBar(); Program.motionDetector.DrawMotionRect = setting.DrawMotionRect; var faceSearchConfig = new FaceSearchWrapper.FaceSearchConfiguration(); faceSearchConfig.LeftRation = float.Parse(setting.IconLeftExtRatio); faceSearchConfig.TopRation = float.Parse(setting.IconTopExtRatio); faceSearchConfig.RightRation = float.Parse(setting.IconRightExtRatio); faceSearchConfig.BottomRation = float.Parse(setting.IconBottomExtRatio); faceSearchConfig.MinFaceWidth = int.Parse(setting.MinFaceWidth); int maxFaceWidth = int.Parse(setting.MaxFaceWidth); faceSearchConfig.FaceWidthRatio = (float)maxFaceWidth / faceSearchConfig.MinFaceWidth; faceSearchConfig.EnvironmentMode = setting.EnvMode; faceSearchConfig.SearchRectangle = new Rectangle(int.Parse(setting.SrchRegionLeft), int.Parse(setting.SrchRegionTop), int.Parse(setting.SrchRegionWidth), int.Parse(setting.SrchRegionHeight)); Program.faceSearch.Configuration = faceSearchConfig; }