boofcv.alg.tracker.tld
Class TldTemplateMatching<T extends ImageGray>
- java.lang.Object
-
- boofcv.alg.tracker.tld.TldTemplateMatching<T>
-
public class TldTemplateMatching<T extends ImageGray> extends java.lang.ObjectCreatedNCCtemplates 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.
-
-
Constructor Summary
Constructors Constructor and Description TldTemplateMatching(InterpolatePixelS<T> interpolate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddDescriptor(boolean positive, float x0, float y0, float x1, float y1)voidaddDescriptor(boolean positive, ImageRectangle rect)Creates a new descriptor for the specified regiondoublecomputeConfidence(ImageRectangle r)see the other function with the same namedoublecomputeConfidence(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.voidcomputeNccDescriptor(NccFeature f, float x0, float y0, float x1, float y1)Computes the NCC descriptor by sample points at evenly spaced distances inside the rectangleNccFeaturecreateDescriptor()Creates a new descriptor or recycles an old onedoubledistance(NccFeature observed, java.util.List<NccFeature> candidates)Computes the best distance to 'observed' from the candidate list.java.util.List<NccFeature>getTemplateNegative()java.util.List<NccFeature>getTemplatePositive()voidreset()Discard previous results and puts it back into its initial statevoidsetImage(T gray)Must call this function before any of the others which process descriptions
-
-
-
Constructor Detail
-
TldTemplateMatching
public TldTemplateMatching(InterpolatePixelS<T> interpolate)
-
-
Method Detail
-
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, java.util.List<NccFeature> candidates)
Computes the best distance to 'observed' from the candidate list.- Parameters:
observed- Feature being matchedcandidates- Set of candidate matches- Returns:
- score from 0 to 1, where lower is closer
-
getTemplatePositive
public java.util.List<NccFeature> getTemplatePositive()
-
getTemplateNegative
public java.util.List<NccFeature> getTemplateNegative()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG