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

HumanFace added to Maps - in case multiple faces with same MeshFacets and...

HumanFace added to Maps - in case multiple faces with same MeshFacets and different sets of feature points occurred
parent d90652b9
No related branches found
No related tags found
No related merge requests found
......@@ -44,8 +44,8 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
private final Set<FeaturePointType> featurePointTypes;
private final Map<FeaturePointType, Map<MeshFacet, List<Double>>> priorities = new HashMap<>();
private final Map<FeaturePointType, Map<MeshFacet, Double>> featurePointWeights = new HashMap<>();
private final Map<HumanFace, Map<FeaturePointType, Map<MeshFacet, List<Double>>>> priorities = new HashMap<>();
private final Map<HumanFace, Map<FeaturePointType, Map<MeshFacet, Double>>> featurePointWeights = new HashMap<>();
/**
* Constructor.
......@@ -179,27 +179,11 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
return distanceVisitor.getNearestPoints();
}
/**
* Returns priorities of points of the visited faces' mesh facets with respect to
* the given feature point types.
*
* Keys in the (outer) map contain types of feature points according to which the Hausdorff
* distances are prioritized.
* For each feature point type, a map of priorities of vertices of the visited
* faces' mesh facets is stored.
* Keys in this (inner) map contain mesh facets of the visited human faces.
* For each facet of the visited human face, a list of priorities is stored.
* The order of priorities corresponds to the order of vertices
* in the visited facet, i.e., the i-th value is the priority of the i-th vertex
* of the visited face's facet.
*
* @return Priorities of all points of all the visited human faces' facets
*/
public Map<FeaturePointType, Map<MeshFacet, List<Double>>> getPriorities() {
public Map<HumanFace, Map<FeaturePointType, Map<MeshFacet, List<Double>>>> getPriorities() {
return Collections.unmodifiableMap(priorities);
}
public Map<FeaturePointType, Map<MeshFacet, Double>> getFeaturePointWeights() {
public Map<HumanFace, Map<FeaturePointType, Map<MeshFacet, Double>>> getFeaturePointWeights() {
return Collections.unmodifiableMap(featurePointWeights);
}
......@@ -250,11 +234,13 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
final PrioritySphere priorityVisitor = new PrioritySphere(featurePoint.getPosition(), computeSphereRadius(humanFace));
humanFace.getMeshModel().compute(priorityVisitor, inParallel());
synchronized(this) {
synchronized (this) {
// Retrieve results from the visitor's internal structure
priorities.computeIfAbsent(fpType, featurePointType -> new HashMap<>())
priorities.computeIfAbsent(humanFace, face -> new HashMap<>())
.computeIfAbsent(fpType, featurePointType -> new HashMap<>())
.putAll(priorityVisitor.getPriorities());
featurePointWeights.computeIfAbsent(fpType, featurePointType -> new HashMap<>())
featurePointWeights.computeIfAbsent(humanFace, face -> new HashMap<>())
.computeIfAbsent(fpType, featurePointType -> new HashMap<>())
.putAll(priorityVisitor.getWeightedDistances());
}
}
......
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