public class NNClassifier extends Object
DetectorCascade. Holding a list of falsePositives and truePositives,
a classification score can be ascribed to a new patch which can be used as a
confidence that a given patch is positive. This is calculated using the
correlation between the new patch and the false positive and falst negatives
such that:
confidence = dP / (dN + dP)
and dP = max(corr(patch,truePositives)) dP = max(corr(patch,falsePositives))
if no true positives have been seen, classify will always return 0 if not
false positives have been seen, classify will always return 1
classify is used by filter such that if the confidence of a patch is larger
than thetaTP the patch is though to be a good patch for the object.| Modifier and Type | Field and Description |
|---|---|
boolean |
enabled
whether this stage is enabled
|
float |
thetaFP
Used as the lower bound of a historysis threshold (i.e.
|
float |
thetaTP
Used as the upper bound threshold
|
| Constructor and Description |
|---|
NNClassifier()
Sets thetaFP as 0.5f and thetaTP as .65f
|
| Modifier and Type | Method and Description |
|---|---|
float |
classifyBB(FImage img,
Rectangle bb) |
float |
classifyPatch(NormalizedPatch patch) |
boolean |
filter(FImage img,
int windowIdx) |
List<NormalizedPatch> |
getPositivePatches() |
void |
learn(List<NormalizedPatch> patches)
Given a list of patches, classify each patch.
|
void |
release()
clear falst positives and true positives
|
public boolean enabled
public float thetaFP
thetaTP, the next detection can be a
little worse by matching this)public float thetaTP
public NNClassifier()
public void release()
public float classifyPatch(NormalizedPatch patch)
patch - public float classifyBB(FImage img, Rectangle bb)
img - bb - public boolean filter(FImage img, int windowIdx)
img - windowIdx - public void learn(List<NormalizedPatch> patches)
thetaTP add the patch
to the true positives If the patch is said to be negative and has a
confidence higher than thetaFP add the patch to the false
positivespatches - public List<NormalizedPatch> getPositivePatches()