Loading LandmarksEngines/src/main/java/cz/fidentis/analyst/engines/landmarks/impl/NoseTipDetectorImpl.java +6 −7 Original line number Diff line number Diff line Loading @@ -15,8 +15,8 @@ import java.util.stream.Collectors; */ public class NoseTipDetectorImpl { private static final double MAX_H_CURVATURE = 0.08; private static final double MIN_K_CURVATURE = 0.008; private static final double H_TRESHOLD = 0.04; private static final double K_TRESHOLD = 0.0005; /** * Detects nose tip from mesh model using curvature properties. Selects point with the highest Gaussian curvature. Loading @@ -41,7 +41,7 @@ public class NoseTipDetectorImpl { public static List<MeshPoint> detectNoseTipCandidatesFromCurvature(MeshModel meshModel) { validateMeshModel(meshModel); List<MeshPoint> candidatePoints = filterPointsByCurvature(meshModel, MAX_H_CURVATURE, MIN_K_CURVATURE); List<MeshPoint> candidatePoints = filterPointsByCurvature(meshModel); return sortByGaussianCurvatureDesc(candidatePoints); } Loading @@ -51,8 +51,7 @@ public class NoseTipDetectorImpl { * @param meshModel Mesh model * @return Candidates for nose tip */ private static List<MeshPoint> filterPointsByCurvature(MeshModel meshModel, double maxMeanCurvature, double minGaussianCurvature) { private static List<MeshPoint> filterPointsByCurvature(MeshModel meshModel) { validateMeshModel(meshModel); return meshModel.getFacets().parallelStream() Loading @@ -60,8 +59,8 @@ public class NoseTipDetectorImpl { .filter(meshPoint -> { var curvature = meshPoint.getCurvature(); return curvature != null && meshPoint.getCurvature().mean() < maxMeanCurvature && meshPoint.getCurvature().gaussian() > minGaussianCurvature; meshPoint.getCurvature().mean() < H_TRESHOLD && meshPoint.getCurvature().gaussian() > K_TRESHOLD; }) .collect(Collectors.toList()); } Loading LandmarksEngines/src/test/java/cz/fidentis/analyst/engines/landmarks/impl/NoseTipDetectorImplTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class NoseTipDetectorImplTest { private void printNoseCandidatesDetails(List<MeshPoint> candidates) { System.out.printf("Nose tip candidates: %d\n\n", candidates.size()); for (MeshPoint candidate : candidates) { System.out.printf("%.5f, %.5f, %.5f\n", candidate.getX(), candidate.getY(), candidate.getZ()); System.out.printf("v %.5f %.5f %.5f\n", candidate.getX(), candidate.getY(), candidate.getZ()); } } Loading Loading
LandmarksEngines/src/main/java/cz/fidentis/analyst/engines/landmarks/impl/NoseTipDetectorImpl.java +6 −7 Original line number Diff line number Diff line Loading @@ -15,8 +15,8 @@ import java.util.stream.Collectors; */ public class NoseTipDetectorImpl { private static final double MAX_H_CURVATURE = 0.08; private static final double MIN_K_CURVATURE = 0.008; private static final double H_TRESHOLD = 0.04; private static final double K_TRESHOLD = 0.0005; /** * Detects nose tip from mesh model using curvature properties. Selects point with the highest Gaussian curvature. Loading @@ -41,7 +41,7 @@ public class NoseTipDetectorImpl { public static List<MeshPoint> detectNoseTipCandidatesFromCurvature(MeshModel meshModel) { validateMeshModel(meshModel); List<MeshPoint> candidatePoints = filterPointsByCurvature(meshModel, MAX_H_CURVATURE, MIN_K_CURVATURE); List<MeshPoint> candidatePoints = filterPointsByCurvature(meshModel); return sortByGaussianCurvatureDesc(candidatePoints); } Loading @@ -51,8 +51,7 @@ public class NoseTipDetectorImpl { * @param meshModel Mesh model * @return Candidates for nose tip */ private static List<MeshPoint> filterPointsByCurvature(MeshModel meshModel, double maxMeanCurvature, double minGaussianCurvature) { private static List<MeshPoint> filterPointsByCurvature(MeshModel meshModel) { validateMeshModel(meshModel); return meshModel.getFacets().parallelStream() Loading @@ -60,8 +59,8 @@ public class NoseTipDetectorImpl { .filter(meshPoint -> { var curvature = meshPoint.getCurvature(); return curvature != null && meshPoint.getCurvature().mean() < maxMeanCurvature && meshPoint.getCurvature().gaussian() > minGaussianCurvature; meshPoint.getCurvature().mean() < H_TRESHOLD && meshPoint.getCurvature().gaussian() > K_TRESHOLD; }) .collect(Collectors.toList()); } Loading
LandmarksEngines/src/test/java/cz/fidentis/analyst/engines/landmarks/impl/NoseTipDetectorImplTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class NoseTipDetectorImplTest { private void printNoseCandidatesDetails(List<MeshPoint> candidates) { System.out.printf("Nose tip candidates: %d\n\n", candidates.size()); for (MeshPoint candidate : candidates) { System.out.printf("%.5f, %.5f, %.5f\n", candidate.getX(), candidate.getY(), candidate.getZ()); System.out.printf("v %.5f %.5f %.5f\n", candidate.getX(), candidate.getY(), candidate.getZ()); } } Loading