/// <summary>
 ///   Constructs a new Haar object detector.
 /// </summary>
 /// <param name="cascade">
 ///   The <see cref="HaarCascade"/> to use in the detector's classifier.
 ///   For the default face cascade, please take a look on
 ///   <see cref="Cascades.FaceHaarCascade"/>.
 /// </param>
 /// 
 public HaarObjectDetector(HaarCascade cascade)
 {
     this.classifier = new HaarClassifier(cascade);
     this.detectedObjects = new List<Rectangle>();
     this.baseWidth = cascade.Width;
     this.baseHeight = cascade.Height;
 }
Ejemplo n.º 2
0
        /// <summary>
        ///   Creates a new object that is a copy of the current instance.
        /// </summary>
        /// 
        /// <returns>
        ///   A new object that is a copy of this instance.
        /// </returns>
        /// 
        public object Clone()
        {
            HaarCascadeStage[] newStages = new HaarCascadeStage[Stages.Length];
            for (int i = 0; i < newStages.Length; i++)
                newStages[i] = (HaarCascadeStage)Stages[i].Clone();

            HaarCascade r = new HaarCascade(Width, Height);
            r.HasTiltedFeatures = this.HasTiltedFeatures;
            r.Stages = newStages;

            return r;
        }
Ejemplo n.º 3
0
 /// <summary>
 ///   Constructs a new classifier.
 /// </summary>
 public HaarClassifier(HaarCascade cascade)
 {
     this.cascade = cascade;
 }