Commit b87d11dd authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Selection of feature points by their type corrected

parent 48225d08
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -330,7 +330,10 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
            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;
    }
}