Package boofcv.alg.tracker.tld
Class TldTemplateMatching<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.tracker.tld.TldTemplateMatching<T>
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescriptor
(boolean positive, float x0, float y0, float x1, float y1) void
addDescriptor
(boolean positive, ImageRectangle rect) Creates a new descriptor for the specified regiondouble
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.double
see the other function with the same namevoid
computeNccDescriptor
(NccFeature f, float x0, float y0, float x1, float y1) Computes the NCC descriptor by sample points at evenly spaced distances inside the rectangleCreates a new descriptor or recycles an old onedouble
distance
(NccFeature observed, List<NccFeature> candidates) Computes the best distance to 'observed' from the candidate list.void
reset()
Discard previous results and puts it back into its initial statevoid
Must call this function before any of the others which process descriptions
-
Field Details
-
unused
-
-
Constructor Details
-
TldTemplateMatching
-
TldTemplateMatching
protected TldTemplateMatching()
-
-
Method Details
-
reset
public void reset()Discard previous results and puts it back into its initial state -
setImage
Must call this function before any of the others which process descriptions- Parameters:
gray
- Input image
-
addDescriptor
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
Computes the NCC descriptor by sample points at evenly spaced distances inside the rectangle -
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
see the other function with the same name -
distance
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
-
getTemplateNegative
-