public static final boolean checkConfidences(final TrackedPosture3DFloat posture, final boolean right) { return postureConfidence(posture, right) == 1.0; }
/** * Does the same as pointingProbability except using a different model that lead to a higher AUC for the training data, but does not offer thresholds of a similar feasability. * * @param posture the observed posture. * @param right true, if the arm for which the probability is calculated is the right (not left) one. * @return The probability of the tracked person pointing with the specified arm calculated based on empirical data. */ private double pointingProbabilityHigherAUC(final TrackedPosture3DFloat posture, final boolean right) { final double elbowAngle = getElbowAngle(posture, right); final double handHeightAngle = getHandHeightAngle(posture, right, true); final double heightFactor = 0.5 + 0.5 * Math.tanh((107 - handHeightAngle) / 18); final double expectedElbowAngle = handHeightAngle >= 80 ? 180 : (handHeightAngle - 4) * 30 / 76 + 150; final double extension_factor = (new NormalDistribution(expectedElbowAngle, 40)).density(elbowAngle) * 100; return Math.min(heightFactor * extension_factor, 1.0) * PostureFunctions.postureConfidence(posture, right); } }
/** * Returns the overall probability that the observed posture is performing a pointing the gesture on the specified side. * * @param posture the observed posture. * @param right true, if the arm for which the probability is calculated is the right (not left) one. * @return The probability of the tracked person pointing with the specified arm calculated based on empirical data. */ public static double pointingProbability(final TrackedPosture3DFloat posture, final boolean right) { //Recommended threshold: 0.3/0.4 final double elbowAngle = getElbowAngle(posture, right); final double handHeightAngle = getHandHeightAngle(posture, right, false); final double heightFactor = 0.5 + 0.5 * Math.tanh((140 - handHeightAngle) / 20); final double expectedElbowAngle = handHeightAngle >= 60 ? 180 : (handHeightAngle - 20) * 0.75 + 150; final double extension_factor = (new NormalDistribution(expectedElbowAngle, 40)).density(elbowAngle) * 100; return Math.min(heightFactor * extension_factor, 1.0) * PostureFunctions.postureConfidence(posture, right); }