Class TldTemplateMatching<T extends ImageGray<T>>

java.lang.Object
boofcv.alg.tracker.tld.TldTemplateMatching<T>

public class TldTemplateMatching<T extends ImageGray<T>>
extends Object
Created NCC templates to describe the target region. Each template is composed of a 15x15 area. The descriptor is computed by sampling evenly spaced points through out the rectangular region. Confidence values are computed based in the distance a point is from the closest positive and negative template.
  • Field Details

  • Constructor Details

    • TldTemplateMatching

      public TldTemplateMatching​(InterpolatePixelS<T> interpolate)
    • TldTemplateMatching

      protected TldTemplateMatching()
  • Method Details

    • reset

      public void reset()
      Discard previous results and puts it back into its initial state
    • setImage

      public void setImage​(T gray)
      Must call this function before any of the others which process descriptions
      Parameters:
      gray - Input image
    • addDescriptor

      public void addDescriptor​(boolean positive, ImageRectangle rect)
      Creates a new descriptor for the specified region
      Parameters:
      positive - if it is a positive or negative example
    • addDescriptor

      public void addDescriptor​(boolean positive, float x0, float y0, float x1, float y1)
    • computeNccDescriptor

      public void computeNccDescriptor​(NccFeature f, float x0, float y0, float x1, float y1)
      Computes the NCC descriptor by sample points at evenly spaced distances inside the rectangle
    • createDescriptor

      public NccFeature createDescriptor()
      Creates a new descriptor or recycles an old one
    • computeConfidence

      public double computeConfidence​(int x0, int y0, int x1, int y1)
      Compute a value which indicates how confident the specified region is to be a member of the positive set. The confidence value is from 0 to 1. 1 indicates 100% confidence. Positive and negative templates are used to compute the confidence value. Only the point in each set which is closest to the specified region are used in the calculation.
      Returns:
      value from 0 to 1, where higher values are more confident
    • computeConfidence

      public double computeConfidence​(ImageRectangle r)
      see the other function with the same name
    • distance

      public double distance​(NccFeature observed, List<NccFeature> candidates)
      Computes the best distance to 'observed' from the candidate list.
      Parameters:
      observed - Feature being matched
      candidates - Set of candidate matches
      Returns:
      score from 0 to 1, where lower is closer
    • getTemplatePositive

      public List<NccFeature> getTemplatePositive()
    • getTemplateNegative

      public List<NccFeature> getTemplateNegative()