|
using System;
using System.Collections.Generic;
using System.Text;
namespace Tracker
{
public enum TrackerType { CENTROID, MEANSHIFT, MEANSHIFTKERNEL, MEANSHIFTKERNELBG }
public class TrackerFactory
{
public TrackerFactory(TrackerType type)
{
_type = type;
CreateTracker();
}
public ITracker Tracker
{
get
{
if (_tracker == null)
CreateTracker();
return _tracker;
}
}
private void CreateTracker()
{ //only single type for now
switch (_type)
{
case TrackerType.CENTROID:
_tracker = new Centroid();
break;
case TrackerType.MEANSHIFT:
_tracker = new Meanshift();
break;
case TrackerType.MEANSHIFTKERNEL:
_tracker = new MeanshiftKernel();
break;
case TrackerType.MEANSHIFTKERNELBG:
_tracker = new MeanshiftKernelBg();
break;
}
}
ITracker _tracker = null;
TrackerType _type = TrackerType.CENTROID; //default to Centroid Tracker
}
}
|
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.
I have been in the IT industry since April 1996. My main expertise is in Microsoft space.
Coming from engineering background, any application of programming to engineering and related fields easily excites me. I like to use OO and design patterns and find them very useful.
I have been an avid reader of CodeProject. I decided it was time to make a commitment to make my contribution to the community - so here I am.
My Website: http://www.puresolutions-online.com