Click here to Skip to main content
15,885,365 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.IO;
using Zoombut.VisualSurveillanceLaboratory.Misc;
using Zoombut.VisualSurveillanceLaboratory.OutputSystem;

namespace Zoombut.FileOutputSystem
{
	public class FileOutput : IOutput
	{
		private TextWriter writer;
		
		private Int32 time = 1;
		/// <summary>
		/// Initializes a new instance of the <see cref="FileOutput"/> class.
		/// </summary>
		/// <param name="path">A path at which to write the file.Can not be null.If path already exists file will be opened.</param>
		public FileOutput(String path)
		{
			writer =
				new StreamWriter(File.Open(path, FileMode.OpenOrCreate, FileAccess.Write));

		}

		#region IOutput Members

		/// <summary>
		/// Outputs the specified blobs.
		/// </summary>
		/// <param name="blobs">The blobs to output.</param>
		/// <exception cref="IOException">Error while trying to output the blobs.</exception>
		/// <exception cref="ObjectDisposedException">Output object is already closed.</exception>
		public void Output(ICollection<ExtendedBlob> blobs)
		{
			foreach (ExtendedBlob blob in blobs)
			{
				writer.WriteLine("{0},{1},{2},{3}", blob.Id, blob.Location.X, blob.Location.Y, time);
				time++;
			}
			writer.Flush();
		}
		/// <summary>
		/// Closes the output.
		/// </summary>
		/// /// 
		/// <exception cref="IOException">Error while trying to close.</exception>
		public void Close()
		{
			writer.Close();
		}

		#endregion
	}
}

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