diff --git a/build.gradle.kts b/build.gradle.kts index a3fdbd5..c4ae096 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("io.vacco.oss.gitflow") version "0.9.8" } group = "io.vacco.kimaris" -version = "0.1.1" +version = "0.1.2" configure { addJ8Spec() diff --git a/src/main/java/io/vacco/kimaris/impl/KmDetFace.java b/src/main/java/io/vacco/kimaris/impl/KmDetFace.java index e6b2b09..89fd64c 100644 --- a/src/main/java/io/vacco/kimaris/impl/KmDetFace.java +++ b/src/main/java/io/vacco/kimaris/impl/KmDetFace.java @@ -5,11 +5,6 @@ public class KmDetFace { - private static int binTestGtEq(int px1, int px2) { - if (px1 <= px2) { return 1; } - return 0; - } - public static double classifyRegion(int r, int c, int s, int treeDepth, byte[] pixels, int dim, KmFaceCascade pg) { double out = 0; int root = 0, px1, px2; @@ -23,7 +18,7 @@ public static double classifyRegion(int r, int c, int s, int treeDepth, byte[] p x2 = ((r + pg.treeCodes[root + 4 * idx + 2] * s) >> 8) * dim + ((c + pg.treeCodes[root + 4 * idx + 3] * s) >> 8); px1 = pixels[x1] & 0xff; px2 = pixels[x2] & 0xff; - idx = 2 * idx + binTestGtEq(px1, px2); + idx = 2 * idx + (px1 <= px2 ? 1 : 0); } out += pg.treePred[treeDepth * i + idx - treeDepth]; if (out <= pg.treeThreshold[i]) { diff --git a/src/main/java/io/vacco/kimaris/impl/KmDetPup.java b/src/main/java/io/vacco/kimaris/impl/KmDetPup.java index 5a93e2c..7f6f9d8 100644 --- a/src/main/java/io/vacco/kimaris/impl/KmDetPup.java +++ b/src/main/java/io/vacco/kimaris/impl/KmDetPup.java @@ -5,11 +5,6 @@ public class KmDetPup { - private static int binTestLt(int px1, int px2) { - if (px1 > px2) { return 1; } - return 0; - } - public static void classifyRegion(double r, double c, double s, int treeDepth, int nrows, int ncols, byte[] pixels, int dim, boolean flipV, @@ -32,7 +27,7 @@ public static void classifyRegion(double r, double c, double s, } px1 = pixels[r1 * dim + c1] & 0xff; px2 = pixels[r2 * dim + c2] & 0xff; - idx = 2 * idx + 1 + binTestLt(px1, px2); + idx = 2 * idx + 1 + (px1 > px2 ? 1 : 0); } int lutIdx = 2 * (int) (plc.trees * treeDepth * i + treeDepth * j + idx - (treeDepth - 1)); dr += plc.treePreds[lutIdx + 0];