Skip to content
Snippets Groups Projects
Commit b87d11dd authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Selection of feature points by their type corrected

parent 48225d08
No related branches found
No related tags found
No related merge requests found
......@@ -322,15 +322,18 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
public void visitHumanFace(HumanFace humanFace) {
// Compute the Hasudorff distance using the 'distanceVisitor'
humanFace.getMeshModel().compute(distanceVisitor, inParallel());
final Map<MeshFacet, List<Double>> hausdorffDistances = distanceVisitor.getDistances();
// Compute priorities of humanFace's vertices for each of the given feature point types
for (final Map.Entry<FeaturePointType, Double> fpType: featurePointTypes.entrySet()) {
final FeaturePointType featurePointType = fpType.getKey();
final double featurePointRadius = fpType.getValue();
final FeaturePoint featurePoint = humanFace.getFeaturePoints().get(featurePointType.getType()); // Get feature point of desired type
final FeaturePoint featurePoint = getFeaturePointByType(humanFace, featurePointType);
if (featurePoint == null) {
continue;
}
final PrioritySphere priorityVisitor = new PrioritySphere(featurePoint.getPosition(), featurePointRadius);
humanFace.getMeshModel().compute(priorityVisitor, inParallel());
......@@ -377,4 +380,14 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
}
}
}
protected FeaturePoint getFeaturePointByType(HumanFace face, FeaturePointType type) {
for (final FeaturePoint featurePoint: face.getFeaturePoints()) {
if (type.getType() == featurePoint.getFeaturePointType().getType()) {
return featurePoint;
}
}
return null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment