Adjusted some values in xml and video detector for showcase

This commit is contained in:
Bastian Kohler 2023-05-25 10:20:11 +02:00
parent fdb0036ea6
commit 569bd43163
2 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,7 @@ public class VideoDetector {
// Preview Camera Image // Preview Camera Image
private PreviewView previewView = null; private PreviewView previewView = null;
// Check Violation // Check Violation
private final float DELTA_LUMINOSITY_THRESHOLD = 0.3f; private final float DELTA_LUMINOSITY_THRESHOLD = 1.5f;
private Float previousLuminosity = null; private Float previousLuminosity = null;
// On Detection Listener // On Detection Listener
private OnDetectionListener listener; private OnDetectionListener listener;
@ -173,7 +173,7 @@ public class VideoDetector {
private void checkForViolation(float luminosity, float previousLuminosity) { private void checkForViolation(float luminosity, float previousLuminosity) {
float deltaLuminosity = Math.abs(luminosity - previousLuminosity); float deltaLuminosity = Math.abs(luminosity - previousLuminosity);
if (deltaLuminosity > DELTA_LUMINOSITY_THRESHOLD) { if (deltaLuminosity > DELTA_LUMINOSITY_THRESHOLD) {
reportViolation(deltaLuminosity); reportViolation(luminosity);
Log.d("Violation", "Violation"); Log.d("Violation", "Violation");
} }
Log.d("Delta", String.valueOf(Math.abs(previousLuminosity - luminosity))); Log.d("Delta", String.valueOf(Math.abs(previousLuminosity - luminosity)));

View File

@ -14,6 +14,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="" android:text=""
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"