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

Unnecessarily repeated computation of feature point weights eliminated

parent 9b0c8eb1
No related branches found
No related tags found
No related merge requests found
...@@ -125,6 +125,8 @@ public class DistanceAction extends ControlPanelAction { ...@@ -125,6 +125,8 @@ public class DistanceAction extends ControlPanelAction {
relativeDist, relativeDist,
true); true);
getSecondaryDrawableFace().getHumanFace().accept(visitor); getSecondaryDrawableFace().getHumanFace().accept(visitor);
setFeaturePointWeigths();
hausdorffDistance = null; hausdorffDistance = null;
} }
...@@ -132,7 +134,6 @@ public class DistanceAction extends ControlPanelAction { ...@@ -132,7 +134,6 @@ public class DistanceAction extends ControlPanelAction {
if (hausdorffDistance == null) { if (hausdorffDistance == null) {
hausdorffDistance = getWeightedDistance(); hausdorffDistance = getWeightedDistance();
setHausdorffDistanceStatistics(); setHausdorffDistanceStatistics();
setFeaturePointWeigths();
} }
getSecondaryDrawableFace().setHeatMap(hausdorffDistance); getSecondaryDrawableFace().setHeatMap(hausdorffDistance);
} }
...@@ -189,11 +190,6 @@ public class DistanceAction extends ControlPanelAction { ...@@ -189,11 +190,6 @@ public class DistanceAction extends ControlPanelAction {
* the weights of feature points used to calculate the weighted Hausdorff distance. * the weights of feature points used to calculate the weighted Hausdorff distance.
*/ */
private void setFeaturePointWeigths() { private void setFeaturePointWeigths() {
if (!weightedDist) {
controlPanel.updateFeaturePointWeights(Map.of());
return;
}
controlPanel.updateFeaturePointWeights( controlPanel.updateFeaturePointWeights(
visitor.getFeaturePointWeights() visitor.getFeaturePointWeights()
.get(getSecondaryDrawableFace().getHumanFace()) // Get FP weights for the secondary face .get(getSecondaryDrawableFace().getHumanFace()) // Get FP weights for the secondary face
......
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