diff --git a/Comparison/src/main/java/cz/fidentis/analyst/procrustes/ProcrustesAnalysis.java b/Comparison/src/main/java/cz/fidentis/analyst/procrustes/ProcrustesAnalysis.java deleted file mode 100644 index 39e798d0464874f44fdbe36bb368fc3bf6d3563e..0000000000000000000000000000000000000000 --- a/Comparison/src/main/java/cz/fidentis/analyst/procrustes/ProcrustesAnalysis.java +++ /dev/null @@ -1,62 +0,0 @@ -package cz.fidentis.analyst.procrustes; - -import cz.fidentis.analyst.feature.FeaturePoint; -import cz.fidentis.analyst.procrustes.exceptions.ProcrustesAnalysisException; -import cz.fidentis.analyst.procrustes.utils.ProcrustesAnalysisUtils; -import java.util.List; - -/** - * - * @author Jakub Kolman - */ -public class ProcrustesAnalysis { - - private final List<FeaturePoint> orderedFpList1; - private final List<FeaturePoint> orderedFpList2; - - /** - * - * @param fpList1 - * @param fpList2 - * @throws ProcrustesAnalysisException - */ - public ProcrustesAnalysis(List<FeaturePoint> fpList1, List<FeaturePoint> fpList2) throws ProcrustesAnalysisException { - if (fpList1.size() != fpList2.size()) { - throw new ProcrustesAnalysisException("Lists of feature points do not have the same size"); - } - orderedFpList1 = ProcrustesAnalysisUtils.sortByFeaturePointType(fpList1); - orderedFpList2 = ProcrustesAnalysisUtils.sortByFeaturePointType(fpList2); - - if (!ProcrustesAnalysisUtils.checkfeaturePointsType(orderedFpList1, orderedFpList2)) { - throw new ProcrustesAnalysisException("Lists of feature points do not have the same feature point types"); - } - } - - /** - * Calculate scaling ratio of how much the appropriate object corresponding to the second feature - * point list has to be scale up or shrunk. - * - * If returned ratioValue is greater 1 then it means that the second object should be scaled up ratioValue times. - * If returned ratioValue is smaller 1 than the second object should be shrunk. - * - * @return ratioValue - */ - private double calculateScalingValue() { - double[] distancesOfList1 = ProcrustesAnalysisUtils.calculateMeanDistancesFromOrigin(orderedFpList1); - double[] distancesOfList2 = ProcrustesAnalysisUtils.calculateMeanDistancesFromOrigin(orderedFpList2); - - double[] ratioArray = new double[distancesOfList1.length]; - double ratioValue = 0; - - for (int i = 0; i < distancesOfList1.length; i++) { - ratioArray[i] += distancesOfList1[i] / distancesOfList2[i]; - } - - for (double ratio: ratioArray) { - ratioValue += ratio; - } - - return ratioValue / distancesOfList1.length; - } - -} diff --git a/Comparison/src/main/java/cz/fidentis/analyst/procrustes/exceptions/ProcrustesAnalysisException.java b/Comparison/src/main/java/cz/fidentis/analyst/procrustes/exceptions/ProcrustesAnalysisException.java deleted file mode 100644 index faff89ddfb12f3b9a02d47a210fd559fb15c36a4..0000000000000000000000000000000000000000 --- a/Comparison/src/main/java/cz/fidentis/analyst/procrustes/exceptions/ProcrustesAnalysisException.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package cz.fidentis.analyst.procrustes.exceptions; - -/** - * - * @author Jakub Kolman - */ -public class ProcrustesAnalysisException extends RuntimeException { - - /** - * throws run time exception with message - * @param message - */ - public ProcrustesAnalysisException(String message) { - super(message); - } -}