public class TldTemplateMatching<T extends boofcv.struct.image.ImageGray<T>>
extends java.lang.Object
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.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Stack<boofcv.struct.feature.NccFeature> |
unused |
| Modifier | Constructor and Description |
|---|---|
protected |
TldTemplateMatching() |
|
TldTemplateMatching(boofcv.alg.interpolate.InterpolatePixelS<T> interpolate) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDescriptor(boolean positive,
float x0,
float y0,
float x1,
float y1) |
void |
addDescriptor(boolean positive,
boofcv.struct.ImageRectangle rect)
Creates a new descriptor for the specified region
|
double |
computeConfidence(boofcv.struct.ImageRectangle r)
see the other function with the same name
|
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.
|
void |
computeNccDescriptor(boofcv.struct.feature.NccFeature f,
float x0,
float y0,
float x1,
float y1)
Computes the NCC descriptor by sample points at evenly spaced distances inside the rectangle
|
boofcv.struct.feature.NccFeature |
createDescriptor()
Creates a new descriptor or recycles an old one
|
double |
distance(boofcv.struct.feature.NccFeature observed,
java.util.List<boofcv.struct.feature.NccFeature> candidates)
Computes the best distance to 'observed' from the candidate list.
|
java.util.List<boofcv.struct.feature.NccFeature> |
getTemplateNegative() |
java.util.List<boofcv.struct.feature.NccFeature> |
getTemplatePositive() |
void |
reset()
Discard previous results and puts it back into its initial state
|
void |
setImage(T gray)
Must call this function before any of the others which process descriptions
|
public TldTemplateMatching(boofcv.alg.interpolate.InterpolatePixelS<T> interpolate)
protected TldTemplateMatching()
public void reset()
public void setImage(T gray)
gray - Input imagepublic void addDescriptor(boolean positive,
boofcv.struct.ImageRectangle rect)
positive - if it is a positive or negative examplepublic void addDescriptor(boolean positive,
float x0,
float y0,
float x1,
float y1)
public void computeNccDescriptor(boofcv.struct.feature.NccFeature f,
float x0,
float y0,
float x1,
float y1)
public boofcv.struct.feature.NccFeature createDescriptor()
public double computeConfidence(int x0,
int y0,
int x1,
int y1)
public double computeConfidence(boofcv.struct.ImageRectangle r)
public double distance(boofcv.struct.feature.NccFeature observed,
java.util.List<boofcv.struct.feature.NccFeature> candidates)
observed - Feature being matchedcandidates - Set of candidate matchespublic java.util.List<boofcv.struct.feature.NccFeature> getTemplatePositive()
public java.util.List<boofcv.struct.feature.NccFeature> getTemplateNegative()