Click here to Skip to main content
15,886,067 members
Articles / Multimedia / GDI+

Visual Surveillance Laboratory

Rate me:
Please Sign up or sign in to vote.
4.85/5 (45 votes)
6 Aug 2008Apache8 min read 147.2K   11K   241  
A description of surveillance systems
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Zoombut.VisualSurveillanceLaboratory.SurveillanceSystem
{
	public partial class ExampleConfigurationForm : ConfigurationForm
	{
		public ExampleConfigurationForm()
		{
			InitializeComponent();
			// Default value must be set.
			args.Add("Threshold", (byte)40);
		}

		/// <summary>
		/// This are the arguments.
		/// </summary>
		private IDictionary<String, Object> args = new Dictionary<String, Object>();
		
		/// <summary>
		/// Gets configuration as supplied by the user using this form.
		/// This configuration will be later used by a tracking system.
		/// </summary>
		/// <returns>A dictionary of configuration options.</returns>
		public override IDictionary<string, object> GetConfiguration()
		{
			return args;
		}

		/// <summary>
		/// Handles the Click event of the btnOk control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
		private void btnOk_Click(object sender, EventArgs e)
		{
			// Check that values are correct.
			byte threshold;
			if (Byte.TryParse(txtThreshold.Text, out threshold))
			{
				args.Clear();
				args.Add("Threshold", threshold);
				this.DialogResult = DialogResult.OK;
				// Result is OK
				Hide();
			} else
			{
				// Indicate an error.
				MessageBox.Show(this, "Values nust be between 0 and 255.", "Invalid Input",
									MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
			
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			txtThreshold.Text = args["Threshold"].ToString();
		}

		private void ExampleConfigurationForm_Load(object sender, EventArgs e)
		{

		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Software Developer
Israel Israel
A computer science master student at Bar Ilan University under the supervision of Dr. Gal Kaminka.
Dealing mainly with trajectory mining.

Comments and Discussions