Browse Source

Fixed another bug with calculating pixels changed

bk_service
Bastian Kohler 1 year ago
parent
commit
1aea88d08f

+ 1
- 1
app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java View File



int n = OpenCVHelper.countNonZeroPixels(processed); int n = OpenCVHelper.countNonZeroPixels(processed);
int pixelCount = image.getWidth() * image.getHeight(); int pixelCount = image.getWidth() * image.getHeight();
float percentChanged = (float) (n / pixelCount) * 100;
float percentChanged = ((float) n / pixelCount) * 100;


// Violation Condition // Violation Condition
if (percentChanged> ALARM_THRESHOLD) { if (percentChanged> ALARM_THRESHOLD) {

Loading…
Cancel
Save